Commit b08070ec authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o
Browse files

ext4: don't remount read-only with errors=continue on reboot

ext4_handle_error() with errors=continue mount option can accidentally
remount the filesystem read-only when the system is rebooting. Fix that.

Fixes: 1dc1097f

 ("ext4: avoid panic during forced reboot")
Signed-off-by: default avatarJan Kara <>
Reviewed-by: default avatarAndreas Dilger <>

Signed-off-by: default avatarTheodore Ts'o <>
parent 46e294ef
......@@ -666,19 +666,17 @@ static bool system_going_down(void)
static void ext4_handle_error(struct super_block *sb)
journal_t *journal = EXT4_SB(sb)->s_journal;
if (test_opt(sb, WARN_ON_ERROR))
if (sb_rdonly(sb))
if (sb_rdonly(sb) || test_opt(sb, ERRORS_CONT))
if (!test_opt(sb, ERRORS_CONT)) {
journal_t *journal = EXT4_SB(sb)->s_journal;
ext4_set_mount_flag(sb, EXT4_MF_FS_ABORTED);
if (journal)
jbd2_journal_abort(journal, -EIO);
ext4_set_mount_flag(sb, EXT4_MF_FS_ABORTED);
if (journal)
jbd2_journal_abort(journal, -EIO);
* We force ERRORS_RO behavior when system is rebooting. Otherwise we
* could panic during 'reboot -f' as the underlying device got already
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