Re: [PATCH 05/16] btrfs: move volume_mutex to callers of btrfs_rm_device

2018-04-05 Thread David Sterba
On Thu, Apr 05, 2018 at 05:41:57PM +0800, Anand Jain wrote: > > > @@ -2716,6 +2718,7 @@ static long btrfs_ioctl_rm_dev(struct file *file, > > void __user *arg) > > ret = BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS; > > goto out_drop_write; > > } > > +

Re: [PATCH 05/16] btrfs: move volume_mutex to callers of btrfs_rm_device

2018-04-05 Thread Anand Jain
@@ -2716,6 +2718,7 @@ static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) ret = BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS; goto out_drop_write; } + mutex_lock(_info->volume_mutex); vol_args = memdup_user(arg, sizeof(*vol_args));

[PATCH 05/16] btrfs: move volume_mutex to callers of btrfs_rm_device

2018-04-03 Thread David Sterba
Move locking and unlocking next to the BTRFS_FS_EXCL_OP bit manipulation so it's obvious that the two happen at the same time. Signed-off-by: David Sterba --- fs/btrfs/ioctl.c | 4 fs/btrfs/volumes.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git