Commit 6af3a56e1dd4d95836a47214e5c60d5b749a5501

Authored by Al Viro
Committed by Al Viro
1 parent 45048d0961

[PATCH] get rid of struct file use in blkdev_ioctl() BLKBSZSET

We need to do bd_claim() only if file hadn't been opened with O_EXCL
and then we have no need to use file itself as owner.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

... ... @@ -343,10 +343,11 @@
343 343 return -EINVAL;
344 344 if (get_user(n, (int __user *) arg))
345 345 return -EFAULT;
346   - if (bd_claim(bdev, file) < 0)
  346 + if (!(mode & FMODE_EXCL) && bd_claim(bdev, &bdev) < 0)
347 347 return -EBUSY;
348 348 ret = set_blocksize(bdev, n);
349   - bd_release(bdev);
  349 + if (!(mode & FMODE_EXCL))
  350 + bd_release(bdev);
350 351 return ret;
351 352 case BLKPG:
352 353 lock_kernel();