FILESYSTEM: disable some un-needed debugging info
/fs/ext4/super.c
blob:113b10768445861525cf42d64fbb3437c771121f -> blob:e754472e5d45b57a85f88ddf34e1a8b21ab7467b
--- fs/ext4/super.c
+++ fs/ext4/super.c
@@ -3619,8 +3619,7 @@ no_journal:
goto failed_mount4;
}
- if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY))
- sb->s_flags |= MS_RDONLY;
+ ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
/* determine the minimum size of new large inodes, if present */
if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {
@@ -3723,8 +3722,16 @@ no_journal:
return 0;
cantfind_ext4:
+
+ /* for debugging, sangwoo2.lee */
+ /* If you wanna use the flag 'MS_SILENT', call 'print_bh' function within below 'if'. */
+ printk("printing data of superblock-bh\n");
+ print_bh(sb, bh, 0, EXT4_BLOCK_SIZE(sb));
+ /* for debugging */
+
if (!silent)
ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem");
+
goto failed_mount;
failed_mount4:
@@ -4823,6 +4830,55 @@ out:
#endif
+/* for debugging, sangwoo2.lee */
+void print_bh(struct super_block *sb, struct buffer_head *bh, int start, int len)
+{
+ print_block_data(sb, bh->b_blocknr, bh->b_data, start, len);
+}
+
+void print_block_data(struct super_block *sb, sector_t blocknr, unsigned char *data_to_dump, int start, int len)
+{
+ int i, j;
+ int bh_offset = (start / 16) * 16;
+ char row_data[17] = { 0, };
+ char row_hex[50] = { 0, };
+ char ch;
+
+ printk(KERN_ERR "As EXT4-fs error, printing data in hex\n");
+ printk(KERN_ERR " [partition info] s_id : %s, start block# : %llu\n", sb->s_id, sb->s_bdev->bd_part->start_sect);
+ printk(KERN_ERR " dump block# : %llu, start offset(byte) : %d, length(byte) : %d\n", blocknr, start, len);
+ printk(KERN_ERR "-----------------------------------------------------------------------------\n");
+
+ for (i = 0; i < (len + 15) / 16; i++)
+ {
+ for (j = 0; j < 16; j++)
+ {
+ ch = *(data_to_dump + bh_offset + j);
+ if (start <= bh_offset + j && start + len > bh_offset + j)
+ {
+ if (isascii(ch) && isprint(ch))
+ sprintf(row_data + j, "%c", ch);
+ else
+ sprintf(row_data + j, ".");
+
+ sprintf(row_hex + (j * 3), "%2.2x ", ch);
+ }
+ else
+ {
+ sprintf(row_data + j, " ");
+ sprintf(row_hex + (j * 3), "-- ");
+ }
+ }
+
+ printk(KERN_ERR "0x%4.4x : %s | %s\n", bh_offset, row_hex, row_data);
+ bh_offset += 16;
+
+ }
+ printk(KERN_ERR "-----------------------------------------------------------------------------\n");
+}
+/* for debugging */
+
+
static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data)
{