Re: [PATCH v4 06/10] btrfs: start transaction in btrfs_set_prop_trans

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 28, 2019 at 06:36:40PM +0800, Anand Jain wrote:
> >> +	if (!ret) {
> >> +		inode_inc_iversion(inode);
> >> +		inode->i_ctime = current_time(inode);
> >> +		set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags);
> >> +		ret = btrfs_update_inode(trans, root, inode);
> >> +		ASSERT(!ret);
> > 
> > This is not right. The previous code uses BUG_ON which is also not
> > right, but does not silently continue if asserts are compiled out.
> > Please add proper error handling here.
> 
>   Error handling should save and undo of inode version, i_ctime and
>   runtime_flags. Is a new patch for this OK? and here will use BUG_ON
>   as in the original.

Ok, use BUG_ON, it's effectively only a code copy. The error handling
could be tricky here.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux