diff options
author | zhangyi (F) <yi.zhang@huawei.com> | 2019-12-04 20:46:12 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-01-25 02:59:25 -0500 |
commit | 51f57b01e4a3c7d7bdceffd84de35144e8c538e7 (patch) | |
tree | 68766b6ea15e5b97969462bd5eb1b91a6712e9fa /fs/jbd2/checkpoint.c | |
parent | d0a186e0d3e7ac05cc77da7c157dae5aa59f95d9 (diff) | |
download | linux-stable-51f57b01e4a3c7d7bdceffd84de35144e8c538e7.tar.gz linux-stable-51f57b01e4a3c7d7bdceffd84de35144e8c538e7.tar.bz2 linux-stable-51f57b01e4a3c7d7bdceffd84de35144e8c538e7.zip |
ext4, jbd2: ensure panic when aborting with zero errno
JBD2_REC_ERR flag used to indicate the errno has been updated when jbd2
aborted, and then __ext4_abort() and ext4_handle_error() can invoke
panic if ERRORS_PANIC is specified. But if the journal has been aborted
with zero errno, jbd2_journal_abort() didn't set this flag so we can
no longer panic. Fix this by always record the proper errno in the
journal superblock.
Fixes: 4327ba52afd03 ("ext4, jbd2: ensure entering into panic after recording an error in superblock")
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20191204124614.45424-3-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/checkpoint.c')
-rw-r--r-- | fs/jbd2/checkpoint.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 8fff6677a5da..96bf33986d03 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -164,7 +164,7 @@ void __jbd2_log_wait_for_space(journal_t *journal) "journal space in %s\n", __func__, journal->j_devname); WARN_ON(1); - jbd2_journal_abort(journal, 0); + jbd2_journal_abort(journal, -EIO); } write_lock(&journal->j_state_lock); } else { |