Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6af3a56e authored by Al Viro's avatar Al Viro Committed by Al Viro
Browse files

[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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 45048d09
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -343,9 +343,10 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
			return -EINVAL;
		if (get_user(n, (int __user *) arg))
			return -EFAULT;
		if (bd_claim(bdev, file) < 0)
		if (!(mode & FMODE_EXCL) && bd_claim(bdev, &bdev) < 0)
			return -EBUSY;
		ret = set_blocksize(bdev, n);
		if (!(mode & FMODE_EXCL))
			bd_release(bdev);
		return ret;
	case BLKPG: