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

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

 




@@ -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(&fs_info->volume_mutex);
vol_args = memdup_user(arg, sizeof(*vol_args)); if (IS_ERR(vol_args)) { > @@ -2730,6 +2733,7 @@ static long btrfs_ioctl_rm_dev(struct file
*file, void __user *arg)
  		btrfs_info(fs_info, "disk deleted %s", vol_args->name);
  	kfree(vol_args);
  out:
+	mutex_unlock(&fs_info->volume_mutex);
  	clear_bit(BTRFS_FS_EXCL_OP, &fs_info->flags);
  out_drop_write:
  	mnt_drop_write_file(file);

 Why not memdup_user() be outside of volume_mutex?
 But not a big deal either.


Reviewed-by: Anand Jain <anand.jain@xxxxxxxxxx>

Thanks, Anand
--
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