From da2e97f7cf048b0c089ab5d0f756d0b40275ed59 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 12 Jun 1997 04:28:07 +0000 Subject: [PATCH] ChangeLog, pass1.c, problem.c: pass1.c (mark_table_blocks): Mark the superblock and group descriptor blocks first, so that any conflicts between these and the bitmap or inode table blocks is noticed. problem.c: Fix message printed out when a block or inode bitmap conflicts with other fs data, has the correct group number in it. --- e2fsck/ChangeLog | 10 ++++++++++ e2fsck/pass1.c | 37 +++++++++++++++++++------------------ e2fsck/problem.c | 4 ++-- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index b0957d5..70b6a2a 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,13 @@ +Thu Jun 12 00:25:31 1997 Theodore Ts'o + + * pass1.c (mark_table_blocks): Mark the superblock and group + descriptor blocks first, so that any conflicts between + these and the bitmap or inode table blocks is noticed. + + * problem.c: Fix message printed out when a block or inode bitmap + conflicts with other fs data, has the correct group number + in it. + Tue Jun 10 12:07:37 1997 Theodore Ts'o * pass2.c (pass2): Check the error return from ext2fs_dblist_iterate. diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 2c760a9..1e83759 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -1126,6 +1126,25 @@ static void mark_table_blocks(ext2_filsys fs) block = fs->super->s_first_data_block; for (i = 0; i < fs->group_desc_count; i++) { pctx.group = i; + + if (ext2fs_bg_has_super(fs, i)) { + /* + * Mark this group's copy of the superblock + */ + ext2fs_mark_block_bitmap(block_found_map, block); + ext2fs_mark_block_bitmap(block_illegal_map, block); + + /* + * Mark this group's copy of the descriptors + */ + for (j = 0; j < fs->desc_blocks; j++) { + ext2fs_mark_block_bitmap(block_found_map, + block + j + 1); + ext2fs_mark_block_bitmap(block_illegal_map, + block + j + 1); + } + } + /* * Mark the blocks used for the inode table */ @@ -1187,24 +1206,6 @@ static void mark_table_blocks(ext2_filsys fs) fs->group_desc[i].bg_inode_bitmap); } } - - if (ext2fs_bg_has_super(fs, i)) { - /* - * Mark this group's copy of the superblock - */ - ext2fs_mark_block_bitmap(block_found_map, block); - ext2fs_mark_block_bitmap(block_illegal_map, block); - - /* - * Mark this group's copy of the descriptors - */ - for (j = 0; j < fs->desc_blocks; j++) { - ext2fs_mark_block_bitmap(block_found_map, - block + j + 1); - ext2fs_mark_block_bitmap(block_illegal_map, - block + j + 1); - } - } block += fs->super->s_blocks_per_group; } } diff --git a/e2fsck/problem.c b/e2fsck/problem.c index 2752633..573b840 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -115,12 +115,12 @@ static struct e2fsck_problem problem_table[] = { /* Block bitmap conflicts with some other fs block */ { PR_1_BB_CONFLICT, - "@g %N's @b @B at %b @C.\n", + "@g %g's @b @B at %b @C.\n", PROMPT_RELOCATE, 0 }, /* Inode bitmap conflicts with some other fs block */ { PR_1_IB_CONFLICT, - "@g %N's @i @B at %b @C.\n", + "@g %g's @i @B at %b @C.\n", PROMPT_RELOCATE, 0 }, /* Inode table conflicts with some other fs block */ -- 1.8.3.1