|
@@ -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;
|
|
|
}
|
|
|
|
|
|
/*
|