diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-06-25 10:53:13 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-07-05 14:45:55 -0400 |
commit | 993988f65527e5665181b3e4a6161f317e396489 (patch) | |
tree | 7220ce1f1f33c873749b929d0478b3daf3da3ca0 /lib/e2p | |
parent | 8c084167ee5ea4ae28359b0d67d583eb1068465c (diff) | |
download | e2fsprogs-993988f65527e5665181b3e4a6161f317e396489.tar.gz |
Add superblock fields which track first and most recent fs errors
Add superblock fields which track where and when the first and most
recent file system errors occured. These fields are displayed by
dumpe2fs and cleared by e2fsck.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/e2p')
-rw-r--r-- | lib/e2p/ls.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c index b208e661..f2a04ffa 100644 --- a/lib/e2p/ls.c +++ b/lib/e2p/ls.c @@ -341,6 +341,37 @@ void list_super2(struct ext2_super_block * sb, FILE *f) if (sb->s_snapshot_list) fprintf(f, "Snapshot list head: %u\n", sb->s_snapshot_list); + if (sb->s_error_count) + fprintf(f, "FS Error count: %u\n", + sb->s_error_count); + if (sb->s_first_error_time) { + tm = sb->s_first_error_time; + fprintf(f, "First error time: %s", ctime(&tm)); + memset(buf, 0, sizeof(buf)); + strncpy(buf, sb->s_first_error_func, + sizeof(sb->s_first_error_func)); + fprintf(f, "First error function: %s\n", buf); + fprintf(f, "First error line #: %u\n", + sb->s_first_error_line); + fprintf(f, "First error inode #: %u\n", + sb->s_first_error_ino); + fprintf(f, "First error block #: %llu\n", + sb->s_first_error_block); + } + if (sb->s_last_error_time) { + tm = sb->s_last_error_time; + fprintf(f, "Last error time: %s", ctime(&tm)); + memset(buf, 0, sizeof(buf)); + strncpy(buf, sb->s_last_error_func, + sizeof(sb->s_last_error_func)); + fprintf(f, "Last error function: %s\n", buf); + fprintf(f, "Last error line #: %u\n", + sb->s_last_error_line); + fprintf(f, "Last error inode #: %u\n", + sb->s_last_error_ino); + fprintf(f, "Last error block #: %llu\n", + sb->s_last_error_block); + } } void list_super (struct ext2_super_block * s) |