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;
> > }
> > +
@@ -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));
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