Whamcloud - gitweb
ext2fs_set_gdt_csum(): Force the last block group to have a valid block bitmap
authorAndreas Dilger <adilger@dilger.ca>
Mon, 31 Mar 2008 12:34:10 +0000 (08:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 31 Mar 2008 18:28:37 +0000 (14:28 -0400)
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 <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/csum.c
tests/m_uninit/expect.1

index a385d76..70deaa9 100644 (file)
@@ -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;
 
index c6c32b9..8d19a40 100644 (file)
@@ -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: