Skip to content

Commit d7c64cd

Browse files
djwongtytso
authored andcommitted
libext2fs: no need to clear BLOCK_UNINIT during ext2fs_reserve_super_and_bgd
Since the beginning of the uninit_bg feature, the kernel[1] and e2fsck[2] have always been careful to detect the presence of the BLOCK_UNINIT flag, and compute a block bitmap with any group metadata blocks marked in that bitmap. With that in mind, I think it's safe to say that this is a design feature of uninit_bg. Now that we've trained libext2fs to have this same behavior whenever it's loading a block bitmap, we no longer need to unset BLOCK_UNINIT for a group that contains only its own group metadata -- kernel, e2fsck, and e2fsprogs will handle this correctly. [1] kernel git 717d50e4971b81b96c0199c91cdf0039a8cb181a "Ext4: Uninitialized Block Groups" [2] e2fsprogs git f5fa200 "Add support for EXT2_FEATURE_COMPAT_LAZY_BG" Reported-by: Akira Fujita <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent a48da27 commit d7c64cd

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/ext2fs/alloc_sb.c

-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ int ext2fs_reserve_super_and_bgd(ext2_filsys fs,
6565
ext2fs_mark_block_bitmap2(bmap, 0);
6666

6767
if (old_desc_blk) {
68-
if (fs->super->s_reserved_gdt_blocks && fs->block_map == bmap)
69-
ext2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);
7068
num_blocks = old_desc_blocks;
7169
if (old_desc_blk + num_blocks >= ext2fs_blocks_count(fs->super))
7270
num_blocks = ext2fs_blocks_count(fs->super) -

0 commit comments

Comments
 (0)