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)
#define EXT2_ERRORS_PANIC 3 /* Panic */
#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE
+#if (__GNUC__ >= 4)
+#define ext4_offsetof(TYPE,MEMBER) __builtin_offsetof(TYPE,MEMBER)
+#else
+#define ext4_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
/*
* Structure of the super block
*/
__u64 s_snapshot_r_blocks_count; /* reserved blocks for active
snapshot's future use */
__u32 s_snapshot_list; /* inode number of the head of the on-disk snapshot list */
- __u32 s_reserved[155]; /* Padding to the end of the block */
+#define EXT4_S_ERR_START ext4_offsetof(struct ext2_super_block, s_error_count)
+ __u32 s_error_count; /* number of fs errors */
+ __u32 s_first_error_time; /* first time an error happened */
+ __u32 s_first_error_ino; /* inode involved in first error */
+ __u64 s_first_error_block; /* block involved of first error */
+ __u8 s_first_error_func[32]; /* function where the error happened */
+ __u32 s_first_error_line; /* line number where error happened */
+ __u32 s_last_error_time; /* most recent time of an error */
+ __u32 s_last_error_ino; /* inode involved in last error */
+ __u32 s_last_error_line; /* line number where error happened */
+ __u64 s_last_error_block; /* block involved of last error */
+ __u8 s_last_error_func[32]; /* function where the error happened */
+#define EXT4_S_ERR_END ext4_offsetof(struct ext2_super_block, s_error_count)
+ __u32 s_reserved[128]; /* Padding to the end of the block */
};
+#define EXT4_S_ERR_LEN (EXT4_S_ERR_END - EXT4_S_ERR_START)
+
/*
* Codes for operating systems
*/