Commit 897852db authored by Ed L. Cashin's avatar Ed L. Cashin Committed by Linus Torvalds

[PATCH] fix block layer ioctl bug

If the blockdev doesn't implement BLKFLSBUF and returns -ENOTTY we should
still go ahead and perform the VFS-level sync.  We need to test for both
ENOTTY and EINVAL because some SCSI drivers incorrectly return EINVAL.
Signed-off-by: default avatarEd L Cashin <ecashin@coraid.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a47dc7cf
...@@ -194,7 +194,8 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd, ...@@ -194,7 +194,8 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
return -EACCES; return -EACCES;
if (disk->fops->ioctl) { if (disk->fops->ioctl) {
ret = disk->fops->ioctl(inode, file, cmd, arg); ret = disk->fops->ioctl(inode, file, cmd, arg);
if (ret != -EINVAL) /* -EINVAL to handle old uncorrected drivers */
if (ret != -EINVAL && ret != -ENOTTY)
return ret; return ret;
} }
fsync_bdev(bdev); fsync_bdev(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