ext3: Check return value of blkdev_issue_flush()
authorJan Kara <jack@suse.cz>
Mon, 9 Jul 2012 21:40:46 +0000 (23:40 +0200)
committerJan Kara <jack@suse.cz>
Mon, 9 Jul 2012 21:40:46 +0000 (23:40 +0200)
blkdev_issue_flush() can fail. Make sure the error gets properly propagated.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext3/fsync.c

index d4dff278cbd824d5d732af355f1428be27a775ae..b31dbd4c46ad3f1ae9acd41dc274a9aa870656e9 100644 (file)
@@ -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;