Re: [PATCH v2 2/4] Btrfs: fix protection between send and root deletion

2014-01-22 Thread Wang Shilong
Hi David, On 01/22/2014 02:16 AM, David Sterba wrote: On Thu, Jan 16, 2014 at 10:32:38AM +0800, Miao Xie wrote: Your fix makes sure that the deleted root will not get cleaned and stays during the send. Only after it finishes it will be cleaned. Now, what if send fails or is interrupted?

Re: [PATCH v2 2/4] Btrfs: fix protection between send and root deletion

2014-01-22 Thread David Sterba
On Wed, Jan 22, 2014 at 04:44:14PM +0800, Wang Shilong wrote: So we disagree, I see a reason for the deletion protection and will do the patch myself. Let's see if we can get more user feedback then. I'm NAKing this patch in current state, if it helps anything. Both ways are ok for me

Re: [PATCH v2 2/4] Btrfs: fix protection between send and root deletion

2014-01-21 Thread David Sterba
On Thu, Jan 16, 2014 at 10:32:38AM +0800, Miao Xie wrote: Your fix makes sure that the deleted root will not get cleaned and stays during the send. Only after it finishes it will be cleaned. Now, what if send fails or is interrupted? There's no way to redo it. Yes the user can be blamed

Re: [PATCH v2 2/4] Btrfs: fix protection between send and root deletion

2014-01-15 Thread David Sterba
On Tue, Jan 14, 2014 at 10:22:56AM +0800, Miao Xie wrote: On mon, 13 Jan 2014 19:27:45 +0100, David Sterba wrote: The root what is about to be sent out may be deleted after we get it, if there is no in-memory i-node in it, it will be inserted into the dead_roots list immediately, then the

Re: [PATCH v2 2/4] Btrfs: fix protection between send and root deletion

2014-01-15 Thread Miao Xie
On wed, 15 Jan 2014 17:40:38 +0100, David Sterba wrote: On Tue, Jan 14, 2014 at 10:22:56AM +0800, Miao Xie wrote: On mon, 13 Jan 2014 19:27:45 +0100, David Sterba wrote: The root what is about to be sent out may be deleted after we get it, if there is no in-memory i-node in it, it will be

Re: [PATCH v2 2/4] Btrfs: fix protection between send and root deletion

2014-01-13 Thread David Sterba
On Tue, Jan 07, 2014 at 05:25:19PM +0800, Wang Shilong wrote: --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1971,6 +1971,19 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root) } root = list_first_entry(fs_info-dead_roots,

Re: [PATCH v2 2/4] Btrfs: fix protection between send and root deletion

2014-01-13 Thread Miao Xie
On mon, 13 Jan 2014 19:27:45 +0100, David Sterba wrote: On Tue, Jan 07, 2014 at 05:25:19PM +0800, Wang Shilong wrote: --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1971,6 +1971,19 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root) } root =

[PATCH v2 2/4] Btrfs: fix protection between send and root deletion

2014-01-07 Thread Wang Shilong
We should gurantee that parent and clone roots can not be destroyed during send, for this we have two ideas. 1.by holding @subvol_sem, this might be a nightmare, because it will block all subvolumes deletion for a long time. 2.Miao pointed out we can reuse @send_in_progress, that mean we will