Commit 6de43703 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jens Axboe

block: remove BKL from BLKROSET and BLKFLSBUF

We only call the functions set_device_ro(),
invalidate_bdev(), sync_filesystem() and sync_blockdev()
while holding the BKL in these commands. All
of these are also done in other code paths without
the BKL, which leads me to the conclusion that
the BKL is not needed here either.

The reason we hold it here is that it was originally
pushed down into the ioctl function from vfs_ioctl.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 62c2a7d9
...@@ -197,10 +197,8 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, ...@@ -197,10 +197,8 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
if (ret != -EINVAL && ret != -ENOTTY) if (ret != -EINVAL && ret != -ENOTTY)
return ret; return ret;
lock_kernel();
fsync_bdev(bdev); fsync_bdev(bdev);
invalidate_bdev(bdev); invalidate_bdev(bdev);
unlock_kernel();
return 0; return 0;
case BLKROSET: case BLKROSET:
...@@ -212,9 +210,7 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, ...@@ -212,9 +210,7 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
return -EACCES; return -EACCES;
if (get_user(n, (int __user *)(arg))) if (get_user(n, (int __user *)(arg)))
return -EFAULT; return -EFAULT;
lock_kernel();
set_device_ro(bdev, n); set_device_ro(bdev, n);
unlock_kernel();
return 0; return 0;
case BLKDISCARD: { case BLKDISCARD: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment