From d78ea441a2e52f776cc192cc7d1d8b3be2abd971 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 31 Mar 2008 08:34:10 -0400 Subject: [PATCH] ext2fs_set_gdt_csum(): Force the last block group to have a valid block bitmap Never set the UNINIT_BLOCKS flag for the last group since the kernel doesn't handle the case graefully if there is a full set of blocks in each blockgroup marked UNINIT_BLOCKS. The kernel should be fixed up, but in the meantime this avoids hitting the problem, and is more consistent with lazy_bg not marking the last group UNINIT. Signed-off-by: Andreas Dilger Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/csum.c | 2 +- tests/m_uninit/expect.1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c index a385d76c..70deaa98 100644 --- a/lib/ext2fs/csum.c +++ b/lib/ext2fs/csum.c @@ -133,7 +133,7 @@ void ext2fs_set_gdt_csum(ext2_filsys fs) /* skip first and last groups, or groups with GDT backups * because the resize inode has blocks allocated in them. */ - if (i == 0 || (i == fs->group_desc_count - 1 && !csum_flag) || + if (i == 0 || i == fs->group_desc_count - 1 || (ext2fs_bg_has_super(fs, i) && sb->s_reserved_gdt_blocks)) goto checksum; diff --git a/tests/m_uninit/expect.1 b/tests/m_uninit/expect.1 index c6c32b92..8d19a400 100644 --- a/tests/m_uninit/expect.1 +++ b/tests/m_uninit/expect.1 @@ -158,9 +158,9 @@ Group 14: (Blocks 114689-122880) [Inode not init, Block not init] 7934 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: Free inodes: -Group 15: (Blocks 122881-131071) [Inode not init, Block not init] +Group 15: (Blocks 122881-131071) [Inode not init] Block bitmap at 122881 (+0), Inode bitmap at 122882 (+1) Inode table at 122883-123138 (+2) 7933 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes - Free blocks: + Free blocks: 123139-131071 Free inodes: -- 2.11.0