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

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

 



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,
>  			struct btrfs_root, root_list);

You're pulling the root from dead_roots here ...

> +	/*
> +	 * Make sure root is not involved in send,

... and there's no way to send such a thing.

> +	 * if we fail with first root, we return
> +	 * directly rather than continue.
> +	 */
> +	spin_lock(&root->root_item_lock);
> +	if (root->send_in_progress) {
> +		spin_unlock(&fs_info->trans_lock);
> +		spin_unlock(&root->root_item_lock);
> +		return 0;
> +	}
> +	spin_unlock(&root->root_item_lock);
> +
>  	list_del_init(&root->root_list);
>  	spin_unlock(&fs_info->trans_lock);
--
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