Skip to content

Commit 6b76715

Browse files
LiBaokun96tytso
authored andcommitted
ext4: show 'emergency_ro' when EXT4_FLAGS_EMERGENCY_RO is set
After commit d3476f3 ("ext4: don't set SB_RDONLY after filesystem errors") in v6.12-rc1, the 'errors=remount-ro' mode no longer sets SB_RDONLY on errors, which results in us seeing the filesystem is still in rw state after errors. Therefore, after setting EXT4_FLAGS_EMERGENCY_RO, display the emergency_ro option so that users can query whether the current file system has become emergency read-only due to errors through commands such as 'mount' or 'cat /proc/fs/ext4/sdx/options'. Fixes: d3476f3 ("ext4: don't set SB_RDONLY after filesystem errors") Signed-off-by: Baokun Li <[email protected]> Reviewed-by: Jan Kara <[email protected]> Reviewed-by: Zhang Yi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 8f98453 commit 6b76715

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/ext4/super.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,6 +3029,9 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
30293029
if (nodefs && !test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS))
30303030
SEQ_OPTS_PUTS("prefetch_block_bitmaps");
30313031

3032+
if (ext4_emergency_ro(sb))
3033+
SEQ_OPTS_PUTS("emergency_ro");
3034+
30323035
ext4_show_quota_options(seq, sb);
30333036
return 0;
30343037
}

0 commit comments

Comments
 (0)