Re: [PATCH] btrfs: take the error path out if btrfs_attach_transaction() fails

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

 



On Thu, Sep 28, 2017 at 03:13:06PM +0800, Anand Jain wrote:
> > I'd suggest to first get rid of the in-place returns and add necessary
> > labels or separate exit sequences and then address the new error
> > handling.
> 
>    As it goes deeper there are quite a number of things which aren't
>    un-done during fail error return .. adding one more to the list
>    is sb->super_copy updates. With this current design on this function
>    its kind of too difficult to undo and error return. As
>    btrfs_init_new_device() is shared between normal device add and
>    sprout device add. I am mulling on completely removing seed part
>    to outside of the btrfs_init_new_device(). such as ..
>          prepare sprout.
>          ret = btrfs_init_new_device() which is without the seed part
>          if(ret) undo_prepare_sprout
>          else finish sprouting.

Yeah, this would make the code better structured.

>     Also with this I think we would find few duplicate code sections
>     between btrfs_init_new_device() and replace device which will be
>     a nice cleanup as a whole. This is a long term plan, for now
>     I think v4 is good.

Ok, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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