+13
−12
+2
−4
+5
−1
Loading
hulk inclusion
category: bugfix
bugzilla: 34619
CVE: NA
---------------------------
In the ext4 filesystem with errors=panic, if one process is recording
errno in the superblock when invoking jbd2_journal_abort() due to some
error cases, it could be raced by another __ext4_abort() which is
setting the SB_RDONLY flag but missing panic because errno has not been
recorded.
jbd2_journal_abort()
journal->j_flags |= JBD2_ABORT;
jbd2_journal_update_sb_errno()
| __ext4_abort()
| sb->s_flags |= SB_RDONLY;
| if (!JBD2_REC_ERR)
| return;
journal->j_flags |= JBD2_REC_ERR;
Finally, it will no longer trigger panic because the filesystem has
already been set read-only. Fix this by remove JBD2_REC_ERR and switch
to use completion variable instead.
Fixes: 4327ba52 ("ext4, jbd2: ensure entering into panic after recording an error in superblock")
Signed-off-by:
zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by:
Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>