summaryrefslogtreecommitdiff
path: root/fs/ext3/fsync.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-07-09 23:40:46 +0200
committerJan Kara <jack@suse.cz>2012-07-09 23:40:46 +0200
commit44f4f729e7a143b08bd63c33cb78b3181d9f4716 (patch)
tree6a49af7fcbc83b7eec5b98cbb2ac614ed3191309 /fs/ext3/fsync.c
parent349ecd6a3c0e4f97fa4dc6bd3917455ccc106d23 (diff)
downloadlinux-3.10-44f4f729e7a143b08bd63c33cb78b3181d9f4716.tar.gz
linux-3.10-44f4f729e7a143b08bd63c33cb78b3181d9f4716.tar.bz2
linux-3.10-44f4f729e7a143b08bd63c33cb78b3181d9f4716.zip
ext3: Check return value of blkdev_issue_flush()
blkdev_issue_flush() can fail. Make sure the error gets properly propagated. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3/fsync.c')
-rw-r--r--fs/ext3/fsync.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c
index d4dff278cbd..b31dbd4c46a 100644
--- a/fs/ext3/fsync.c
+++ b/fs/ext3/fsync.c
@@ -92,8 +92,13 @@ int ext3_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
* disk caches manually so that data really is on persistent
* storage
*/
- if (needs_barrier)
- blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
+ if (needs_barrier) {
+ int err;
+
+ err = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
+ if (!ret)
+ ret = err;
+ }
out:
trace_ext3_sync_file_exit(inode, ret);
return ret;