From: Baokun Li Date: Wed, 22 Jan 2025 11:41:30 +0000 (+0800) Subject: ext4: show 'shutdown' hint when ext4 is forced to shutdown X-Git-Tag: v6.15-rc1~145^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5855c3519463e9ac4d10424bb49953047a04c602;p=thirdparty%2Fkernel%2Flinux.git ext4: show 'shutdown' hint when ext4 is forced to shutdown Now, if dmesg is cleared, we have no way of knowing if the file system has been shutdown. Moreover, ext4 allows directory reads even after the file system has been shutdown, so when reading a file returns -EIO, we cannot determine whether this is a hardware issue or if the file system has been shutdown. Therefore, when ext4 file system is shutdown, we're adding a 'shutdown' hint to commands like mount so users can easily check the file system's status. Signed-off-by: Baokun Li Reviewed-by: Jan Kara Reviewed-by: Zhang Yi Link: https://patch.msgid.link/20250122114130.229709-8-libaokun@huaweicloud.com Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/super.c b/fs/ext4/super.c index de6c06dc8efef..4e495d5e74a0b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3032,6 +3032,9 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb, if (ext4_emergency_ro(sb)) SEQ_OPTS_PUTS("emergency_ro"); + if (ext4_forced_shutdown(sb)) + SEQ_OPTS_PUTS("shutdown"); + ext4_show_quota_options(seq, sb); return 0; }