Commit 62ec1707 authored by Zhihao Cheng's avatar Zhihao Cheng Committed by Theodore Ts'o

jbd2: replace journal state flag by checking errseq

Now JBD2 detects metadata writeback error of fs dev according to errseq.
Replace journal state flag by checking errseq.
Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Suggested-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20231213013224.2100050-3-chengzhihao1@huawei.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 990b6b5b
...@@ -1862,7 +1862,7 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid, ...@@ -1862,7 +1862,7 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid,
if (is_journal_aborted(journal)) if (is_journal_aborted(journal))
return -EIO; return -EIO;
if (test_bit(JBD2_CHECKPOINT_IO_ERROR, &journal->j_atomic_flags)) { if (jbd2_check_fs_dev_write_error(journal)) {
jbd2_journal_abort(journal, -EIO); jbd2_journal_abort(journal, -EIO);
return -EIO; return -EIO;
} }
...@@ -2160,12 +2160,12 @@ int jbd2_journal_destroy(journal_t *journal) ...@@ -2160,12 +2160,12 @@ int jbd2_journal_destroy(journal_t *journal)
/* /*
* OK, all checkpoint transactions have been checked, now check the * OK, all checkpoint transactions have been checked, now check the
* write out io error flag and abort the journal if some buffer failed * writeback errseq of fs dev and abort the journal if some buffer
* to write back to the original location, otherwise the filesystem * failed to write back to the original location, otherwise the
* may become inconsistent. * filesystem may become inconsistent.
*/ */
if (!is_journal_aborted(journal) && if (!is_journal_aborted(journal) &&
test_bit(JBD2_CHECKPOINT_IO_ERROR, &journal->j_atomic_flags)) jbd2_check_fs_dev_write_error(journal))
jbd2_journal_abort(journal, -EIO); jbd2_journal_abort(journal, -EIO);
if (journal->j_sb_buffer) { if (journal->j_sb_buffer) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment