Skip to content

Commit 5855c35

Browse files
LiBaokun96tytso
authored andcommitted
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 <[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 6b76715 commit 5855c35

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
@@ -3032,6 +3032,9 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
30323032
if (ext4_emergency_ro(sb))
30333033
SEQ_OPTS_PUTS("emergency_ro");
30343034

3035+
if (ext4_forced_shutdown(sb))
3036+
SEQ_OPTS_PUTS("shutdown");
3037+
30353038
ext4_show_quota_options(seq, sb);
30363039
return 0;
30373040
}

0 commit comments

Comments
 (0)