From: Ed L Cashin <ecashin@coraid.com>

If the blockdev doesn't implement BLKFLSBUF and returns -ENOTTY we should
still go ahead and perform the VFS-level sync.

Signed-off-by: Ed L Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/block/ioctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/block/ioctl.c~fix-block-layer-ioctl-bug drivers/block/ioctl.c
--- 25/drivers/block/ioctl.c~fix-block-layer-ioctl-bug	Fri Oct  1 15:13:16 2004
+++ 25-akpm/drivers/block/ioctl.c	Fri Oct  1 15:13:16 2004
@@ -194,7 +194,8 @@ int blkdev_ioctl(struct inode *inode, st
 			return -EACCES;
 		if (disk->fops->ioctl) {
 			ret = disk->fops->ioctl(inode, file, cmd, arg);
-			if (ret != -EINVAL)
+			/* -EINVAL to handle old uncorrected drivers */
+			if (ret != -EINVAL && ret != -ENOTTY)
 				return ret;
 		}
 		fsync_bdev(bdev);
_