jbd2: check return value of blkdev_issue_flush()
authorTheodore Ts'o <tytso@mit.edu>
Fri, 17 Aug 2012 13:56:17 +0000 (09:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 17 Aug 2012 13:56:17 +0000 (09:56 -0400)
blkdev_issue_flush() can fail; make sure the error gets properly
propagated.

This is a port of the equivalent jbd patch from commit 349ecd6a3c0e.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/jbd2/recovery.c

index 0131e4362534c4d5b83273130ee292463ec49f07..626846bac32f8a5f2c01d4e3f39db9332642a25c 100644 (file)
@@ -289,8 +289,11 @@ int jbd2_journal_recover(journal_t *journal)
        if (!err)
                err = err2;
        /* Make sure all replayed data is on permanent storage */
-       if (journal->j_flags & JBD2_BARRIER)
-               blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
+       if (journal->j_flags & JBD2_BARRIER) {
+               err2 = blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
+               if (!err)
+                       err = err2;
+       }
        return err;
 }