[PATCH 06/19] ext2fs: Make ext2fs_reserve_super_and_bgd() clear block_uninit flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently ext2fs_reserve_super_and_bgd() does not change group
descriptor flag showing whether a particular group block bitmap is
initialized or not. Make sure to clear this flag when modifying group's
block bitmap.

Signed-off-by: Jan Kara <jack@xxxxxxxx>
---
 lib/ext2fs/alloc_sb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/ext2fs/alloc_sb.c b/lib/ext2fs/alloc_sb.c
index 8788c00973df..9100ba29ef13 100644
--- a/lib/ext2fs/alloc_sb.c
+++ b/lib/ext2fs/alloc_sb.c
@@ -52,6 +52,11 @@ int ext2fs_reserve_super_and_bgd(ext2_filsys fs,
 	ext2fs_super_and_bgd_loc2(fs, group, &super_blk,
 				  &old_desc_blk, &new_desc_blk, &used_blks);
 
+	if (used_blks && bmap == fs->block_map) {
+		ext2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);
+		ext2fs_group_desc_csum_set(fs, group);
+	}
+
 	if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
 		old_desc_blocks = fs->super->s_first_meta_bg;
 	else
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux