When asynchronous commits are enabled, jbd2_commit_transaction() calls blkdev_issue_flush() on the journal device to make the commit record permanent. However the return value is ignored so if the flush fails, the transaction is considered committed although the commit record may have never reached the disk. Abort the journal when the flush fails, as we already do when waiting for the commit record fails. Fixes: f73bee49855f ("jbd2: Modify ASYNC_COMMIT code to not rely on queue draining on barrier") Cc: stable@vger.kernel.org Signed-off-by: guolingxing --- fs/jbd2/commit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 8c561e42b60a..4e8ebce34077 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -912,7 +912,10 @@ void jbd2_journal_commit_transaction(journal_t *journal) stats.run.rs_blocks_logged++; if (jbd2_has_feature_async_commit(journal) && journal->j_flags & JBD2_BARRIER) { - blkdev_issue_flush(journal->j_dev); + int flush_err = blkdev_issue_flush(journal->j_dev); + + if (!err) + err = flush_err; } if (err) -- 2.34.1