Skip to content

Commit

Permalink
block: remove BKL from BLKROSET and BLKFLSBUF
Browse files Browse the repository at this point in the history
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: Arnd Bergmann <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
arndb authored and Jens Axboe committed Aug 7, 2010
1 parent 62c2a7d commit 6de4370
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions block/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,8 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
if (ret != -EINVAL && ret != -ENOTTY)
return ret;

lock_kernel();
fsync_bdev(bdev);
invalidate_bdev(bdev);
unlock_kernel();
return 0;

case BLKROSET:
Expand All @@ -212,9 +210,7 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
return -EACCES;
if (get_user(n, (int __user *)(arg)))
return -EFAULT;
lock_kernel();
set_device_ro(bdev, n);
unlock_kernel();
return 0;

case BLKDISCARD: {
Expand Down

0 comments on commit 6de4370

Please sign in to comment.