Commit bf862ba5 authored by Nathan Scott's avatar Nathan Scott Committed by Linus Torvalds

[PATCH] blkdev_open/bd_claim vs BLKBSZSET

I was modifying mkfs.xfs to use O_EXCL for 2.6, and hit a snag.
It seems that once I've opened a block dev with O_EXCL I can no
longer issue the BLKBSZSET ioctl to it.

Making this change, the ioctl succeeds cos the original filp bdev owner
from open now matches with the owner in the ioctl call.
parent 63bf3000
...@@ -138,7 +138,6 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd, ...@@ -138,7 +138,6 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
struct block_device *bdev = inode->i_bdev; struct block_device *bdev = inode->i_bdev;
struct gendisk *disk = bdev->bd_disk; struct gendisk *disk = bdev->bd_disk;
struct backing_dev_info *bdi; struct backing_dev_info *bdi;
int holder;
int ret, n; int ret, n;
switch (cmd) { switch (cmd) {
...@@ -175,7 +174,7 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd, ...@@ -175,7 +174,7 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
return -EINVAL; return -EINVAL;
if (get_user(n, (int *) arg)) if (get_user(n, (int *) arg))
return -EFAULT; return -EFAULT;
if (bd_claim(bdev, &holder) < 0) if (bd_claim(bdev, file) < 0)
return -EBUSY; return -EBUSY;
ret = set_blocksize(bdev, n); ret = set_blocksize(bdev, n);
bd_release(bdev); bd_release(bdev);
......
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