aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@redhat.com>2008-04-29 22:00:28 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-04-29 22:00:28 -0400
commitc19204b0ae3f8a125118fd5d425d3c7a5f8fda9b (patch)
treebca9e898c7a66315ffd2551acb52e2db4ec94c3b /fs
parent8753e88f1b4345677620ec68f847222a6301e2fd (diff)
ext4: don't use ext4_error in ext4_check_descriptors
Because ext4_check_descriptors is called at mount time you can't use ext4_error as it calls ext4_commit_sb, which since the sb isn't all the way initialized causes bad things to happen (ie a panic). This patch changes the ext4_error's to printk's to keep this problem from happening. Thanks much, Signed-off-by: Josef Bacik <jbacik@redhat.com> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/super.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3435184114c4..52dd0679a4e2 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1484,36 +1484,33 @@ static int ext4_check_descriptors(struct super_block *sb)
1484 block_bitmap = ext4_block_bitmap(sb, gdp); 1484 block_bitmap = ext4_block_bitmap(sb, gdp);
1485 if (block_bitmap < first_block || block_bitmap > last_block) 1485 if (block_bitmap < first_block || block_bitmap > last_block)
1486 { 1486 {
1487 ext4_error (sb, "ext4_check_descriptors", 1487 printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
1488 "Block bitmap for group %lu" 1488 "Block bitmap for group %lu not in group "
1489 " not in group (block %llu)!", 1489 "(block %llu)!", i, block_bitmap);
1490 i, block_bitmap);
1491 return 0; 1490 return 0;
1492 } 1491 }
1493 inode_bitmap = ext4_inode_bitmap(sb, gdp); 1492 inode_bitmap = ext4_inode_bitmap(sb, gdp);
1494 if (inode_bitmap < first_block || inode_bitmap > last_block) 1493 if (inode_bitmap < first_block || inode_bitmap > last_block)
1495 { 1494 {
1496 ext4_error (sb, "ext4_check_descriptors", 1495 printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
1497 "Inode bitmap for group %lu" 1496 "Inode bitmap for group %lu not in group "
1498 " not in group (block %llu)!", 1497 "(block %llu)!", i, inode_bitmap);
1499 i, inode_bitmap);
1500 return 0; 1498 return 0;
1501 } 1499 }
1502 inode_table = ext4_inode_table(sb, gdp); 1500 inode_table = ext4_inode_table(sb, gdp);
1503 if (inode_table < first_block || 1501 if (inode_table < first_block ||
1504 inode_table + sbi->s_itb_per_group - 1 > last_block) 1502 inode_table + sbi->s_itb_per_group - 1 > last_block)
1505 { 1503 {
1506 ext4_error (sb, "ext4_check_descriptors", 1504 printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
1507 "Inode table for group %lu" 1505 "Inode table for group %lu not in group "
1508 " not in group (block %llu)!", 1506 "(block %llu)!", i, inode_table);
1509 i, inode_table);
1510 return 0; 1507 return 0;
1511 } 1508 }
1512 if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { 1509 if (!ext4_group_desc_csum_verify(sbi, i, gdp)) {
1513 ext4_error(sb, __func__, 1510 printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
1514 "Checksum for group %lu failed (%u!=%u)\n", 1511 "Checksum for group %lu failed (%u!=%u)\n",
1515 i, le16_to_cpu(ext4_group_desc_csum(sbi, i, 1512 i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
1516 gdp)), le16_to_cpu(gdp->bg_checksum)); 1513 gdp)), le16_to_cpu(gdp->bg_checksum));
1517 return 0; 1514 return 0;
1518 } 1515 }
1519 if (!flexbg_flag) 1516 if (!flexbg_flag)