nilfs2: append blocksize info to warnings during loading super blocks
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 23 Jan 2011 15:28:22 +0000 (00:28 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tue, 8 Mar 2011 05:58:30 +0000 (14:58 +0900)
At present, the same warning message can be output twice when nilfs
detected a problem on super blocks:

 NILFS warning: broken superblock. using spare superblock.
 NILFS warning: broken superblock. using spare superblock.
 ...

This is because these super blocks are reloaded with the block size
written in a super block if it differs from the first block size, but
this repetition looks somewhat confusing.  So, we hint at what is
going on by appending block size information to those messages.

Reported-by: Wakko Warner <wakko@animx.eu.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
fs/nilfs2/the_nilfs.c

index ad4ac607cf5734fda535667e898ad9b4cccaab63..9098909d5cef580189eefd17cb8ec5a06432ea30 100644 (file)
@@ -475,10 +475,13 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs,
                        return -EIO;
                }
                printk(KERN_WARNING
-                      "NILFS warning: unable to read primary superblock\n");
-       } else if (!sbp[1])
+                      "NILFS warning: unable to read primary superblock "
+                      "(blocksize = %d)\n", blocksize);
+       } else if (!sbp[1]) {
                printk(KERN_WARNING
-                      "NILFS warning: unable to read secondary superblock\n");
+                      "NILFS warning: unable to read secondary superblock "
+                      "(blocksize = %d)\n", blocksize);
+       }
 
        /*
         * Compare two super blocks and set 1 in swp if the secondary
@@ -505,7 +508,7 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs,
 
        if (!valid[!swp])
                printk(KERN_WARNING "NILFS warning: broken superblock. "
-                      "using spare superblock.\n");
+                      "using spare superblock (blocksize = %d).\n", blocksize);
        if (swp)
                nilfs_swap_super_block(nilfs);