summaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2009-11-03 10:59:10 +0100
committerPhilipp Reisner <philipp.reisner@linbit.com>2009-11-03 10:59:10 +0100
commit59131d8e0ae91f2e94909e0795923c4c7ee7eb8c (patch)
tree118e958961f1a5c2b64783ef239540397c176831 /fs/block_dev.c
parent012abeea669ea49636cf952d13298bb68654146a (diff)
parent4f570f995f68ef77aae7e5a441222f59232f2d0e (diff)
Merge branch 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block into for-2.6.33
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 9cf4b926f8e..dde91e7e1c3 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -405,7 +405,17 @@ static loff_t block_llseek(struct file *file, loff_t offset, int origin)
static int block_fsync(struct file *filp, struct dentry *dentry, int datasync)
{
- return sync_blockdev(I_BDEV(filp->f_mapping->host));
+ struct block_device *bdev = I_BDEV(filp->f_mapping->host);
+ int error;
+
+ error = sync_blockdev(bdev);
+ if (error)
+ return error;
+
+ error = blkdev_issue_flush(bdev, NULL);
+ if (error == -EOPNOTSUPP)
+ error = 0;
+ return error;
}
/*