diff options
Diffstat (limited to 'block/ioctl.c')
-rw-r--r-- | block/ioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/ioctl.c b/block/ioctl.c index 3d866d0037f2..fefa9a496708 100644 --- a/block/ioctl.c +++ b/block/ioctl.c | |||
@@ -295,11 +295,12 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, | |||
295 | return -EINVAL; | 295 | return -EINVAL; |
296 | if (get_user(n, (int __user *) arg)) | 296 | if (get_user(n, (int __user *) arg)) |
297 | return -EFAULT; | 297 | return -EFAULT; |
298 | if (!(mode & FMODE_EXCL) && bd_claim(bdev, &bdev) < 0) | 298 | if (!(mode & FMODE_EXCL) && |
299 | blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0) | ||
299 | return -EBUSY; | 300 | return -EBUSY; |
300 | ret = set_blocksize(bdev, n); | 301 | ret = set_blocksize(bdev, n); |
301 | if (!(mode & FMODE_EXCL)) | 302 | if (!(mode & FMODE_EXCL)) |
302 | bd_release(bdev); | 303 | blkdev_put(bdev, mode | FMODE_EXCL); |
303 | return ret; | 304 | return ret; |
304 | case BLKPG: | 305 | case BLKPG: |
305 | ret = blkpg_ioctl(bdev, (struct blkpg_ioctl_arg __user *) arg); | 306 | ret = blkpg_ioctl(bdev, (struct blkpg_ioctl_arg __user *) arg); |