From: Baokun Li Date: Wed, 22 Jan 2025 11:41:29 +0000 (+0800) Subject: ext4: show 'emergency_ro' when EXT4_FLAGS_EMERGENCY_RO is set X-Git-Tag: v6.15-rc1~145^2~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b76715d5e41fc332b0b879e66fad6ef3db07a3f;p=thirdparty%2Flinux.git ext4: show 'emergency_ro' when EXT4_FLAGS_EMERGENCY_RO is set After commit d3476f3dad4a ("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: d3476f3dad4a ("ext4: don't set SB_RDONLY after filesystem errors") Signed-off-by: Baokun Li Reviewed-by: Jan Kara Reviewed-by: Zhang Yi Link: https://patch.msgid.link/20250122114130.229709-7-libaokun@huaweicloud.com Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 94bd351fd2b19..de6c06dc8efef 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3029,6 +3029,9 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb, if (nodefs && !test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS)) SEQ_OPTS_PUTS("prefetch_block_bitmaps"); + if (ext4_emergency_ro(sb)) + SEQ_OPTS_PUTS("emergency_ro"); + ext4_show_quota_options(seq, sb); return 0; }