diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 3deffd5..d6d55b9 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -314,7 +314,7 @@
 	struct ext_filesystem *fs = get_fs();
 	__u16 crc = 0;
 
-	desc = (struct ext2_block_group *)&fs->gd[i];
+	desc = (struct ext2_block_group *)&fs->bgd[i];
 	if (fs->sb->feature_ro_compat & EXT4_FEATURE_RO_COMPAT_GDT_CSUM) {
 		int offset = offsetof(struct ext2_block_group, bg_checksum);
 
@@ -874,17 +874,17 @@
 	char *zero_buffer = zalloc(fs->blksz);
 	if (!journal_buffer || !zero_buffer)
 		goto fail;
-	struct ext2_block_group *gd = (struct ext2_block_group *)fs->gdtable;
+	struct ext2_block_group *bgd = (struct ext2_block_group *)fs->gdtable;
 
 	if (fs->first_pass_bbmap == 0) {
 		for (i = 0; i < fs->no_blkgrp; i++) {
-			if (gd[i].free_blocks) {
-				if (gd[i].bg_flags & EXT4_BG_BLOCK_UNINIT) {
-					put_ext4(((uint64_t) (gd[i].block_id *
+			if (bgd[i].free_blocks) {
+				if (bgd[i].bg_flags & EXT4_BG_BLOCK_UNINIT) {
+					put_ext4(((uint64_t) (bgd[i].block_id *
 							      fs->blksz)),
 						 zero_buffer, fs->blksz);
-					gd[i].bg_flags =
-					    gd[i].
+					bgd[i].bg_flags =
+					    bgd[i].
 					    bg_flags & ~EXT4_BG_BLOCK_UNINIT;
 					memcpy(fs->blk_bmaps[i], zero_buffer,
 					       fs->blksz);
@@ -897,16 +897,16 @@
 				fs->curr_blkno = fs->curr_blkno +
 						(i * fs->blksz * 8);
 				fs->first_pass_bbmap++;
-				gd[i].free_blocks--;
+				bgd[i].free_blocks--;
 				fs->sb->free_blocks--;
-				status = ext4fs_devread(gd[i].block_id *
+				status = ext4fs_devread(bgd[i].block_id *
 							fs->sect_perblk, 0,
 							fs->blksz,
 							journal_buffer);
 				if (status == 0)
 					goto fail;
 				if (ext4fs_log_journal(journal_buffer,
-							gd[i].block_id))
+							bgd[i].block_id))
 					goto fail;
 				goto success;
 			} else {
@@ -935,19 +935,19 @@
 		if (bg_idx >= fs->no_blkgrp)
 			goto fail;
 
-		if (gd[bg_idx].free_blocks == 0) {
+		if (bgd[bg_idx].free_blocks == 0) {
 			debug("block group %u is full. Skipping\n", bg_idx);
 			fs->curr_blkno = fs->curr_blkno + blk_per_grp;
 			fs->curr_blkno--;
 			goto restart;
 		}
 
-		if (gd[bg_idx].bg_flags & EXT4_BG_BLOCK_UNINIT) {
+		if (bgd[bg_idx].bg_flags & EXT4_BG_BLOCK_UNINIT) {
 			memset(zero_buffer, '\0', fs->blksz);
-			put_ext4(((uint64_t) (gd[bg_idx].block_id * fs->blksz)),
-				 zero_buffer, fs->blksz);
+			put_ext4(((uint64_t) (bgd[bg_idx].block_id *
+					fs->blksz)), zero_buffer, fs->blksz);
 			memcpy(fs->blk_bmaps[bg_idx], zero_buffer, fs->blksz);
-			gd[bg_idx].bg_flags = gd[bg_idx].bg_flags &
+			bgd[bg_idx].bg_flags = bgd[bg_idx].bg_flags &
 						~EXT4_BG_BLOCK_UNINIT;
 		}
 
@@ -961,18 +961,18 @@
 		/* journal backup */
 		if (prev_bg_bitmap_index != bg_idx) {
 			memset(journal_buffer, '\0', fs->blksz);
-			status = ext4fs_devread(gd[bg_idx].block_id
+			status = ext4fs_devread(bgd[bg_idx].block_id
 						* fs->sect_perblk,
 						0, fs->blksz, journal_buffer);
 			if (status == 0)
 				goto fail;
 			if (ext4fs_log_journal(journal_buffer,
-						gd[bg_idx].block_id))
+						bgd[bg_idx].block_id))
 				goto fail;
 
 			prev_bg_bitmap_index = bg_idx;
 		}
-		gd[bg_idx].free_blocks--;
+		bgd[bg_idx].free_blocks--;
 		fs->sb->free_blocks--;
 		goto success;
 	}
@@ -1000,19 +1000,21 @@
 	char *zero_buffer = zalloc(fs->blksz);
 	if (!journal_buffer || !zero_buffer)
 		goto fail;
-	struct ext2_block_group *gd = (struct ext2_block_group *)fs->gdtable;
+	struct ext2_block_group *bgd = (struct ext2_block_group *)fs->gdtable;
 
 	if (fs->first_pass_ibmap == 0) {
 		for (i = 0; i < fs->no_blkgrp; i++) {
-			if (gd[i].free_inodes) {
-				if (gd[i].bg_itable_unused != gd[i].free_inodes)
-					gd[i].bg_itable_unused =
-						gd[i].free_inodes;
-				if (gd[i].bg_flags & EXT4_BG_INODE_UNINIT) {
+			if (bgd[i].free_inodes) {
+				if (bgd[i].bg_itable_unused !=
+						bgd[i].free_inodes)
+					bgd[i].bg_itable_unused =
+						bgd[i].free_inodes;
+				if (bgd[i].bg_flags & EXT4_BG_INODE_UNINIT) {
 					put_ext4(((uint64_t)
-						  (gd[i].inode_id * fs->blksz)),
+						  (bgd[i].inode_id *
+							fs->blksz)),
 						 zero_buffer, fs->blksz);
-					gd[i].bg_flags = gd[i].bg_flags &
+					bgd[i].bg_flags = bgd[i].bg_flags &
 							~EXT4_BG_INODE_UNINIT;
 					memcpy(fs->inode_bmaps[i],
 					       zero_buffer, fs->blksz);
@@ -1025,17 +1027,17 @@
 				fs->curr_inode_no = fs->curr_inode_no +
 							(i * inodes_per_grp);
 				fs->first_pass_ibmap++;
-				gd[i].free_inodes--;
-				gd[i].bg_itable_unused--;
+				bgd[i].free_inodes--;
+				bgd[i].bg_itable_unused--;
 				fs->sb->free_inodes--;
-				status = ext4fs_devread(gd[i].inode_id *
+				status = ext4fs_devread(bgd[i].inode_id *
 							fs->sect_perblk, 0,
 							fs->blksz,
 							journal_buffer);
 				if (status == 0)
 					goto fail;
 				if (ext4fs_log_journal(journal_buffer,
-							gd[i].inode_id))
+							bgd[i].inode_id))
 					goto fail;
 				goto success;
 			} else
@@ -1047,13 +1049,13 @@
 		fs->curr_inode_no++;
 		/* get the blockbitmap index respective to blockno */
 		ibmap_idx = fs->curr_inode_no / inodes_per_grp;
-		if (gd[ibmap_idx].bg_flags & EXT4_BG_INODE_UNINIT) {
+		if (bgd[ibmap_idx].bg_flags & EXT4_BG_INODE_UNINIT) {
 			memset(zero_buffer, '\0', fs->blksz);
-			put_ext4(((uint64_t) (gd[ibmap_idx].inode_id *
+			put_ext4(((uint64_t) (bgd[ibmap_idx].inode_id *
 					      fs->blksz)), zero_buffer,
 				 fs->blksz);
-			gd[ibmap_idx].bg_flags =
-			    gd[ibmap_idx].bg_flags & ~EXT4_BG_INODE_UNINIT;
+			bgd[ibmap_idx].bg_flags =
+			    bgd[ibmap_idx].bg_flags & ~EXT4_BG_INODE_UNINIT;
 			memcpy(fs->inode_bmaps[ibmap_idx], zero_buffer,
 				fs->blksz);
 		}
@@ -1069,21 +1071,22 @@
 		/* journal backup */
 		if (prev_inode_bitmap_index != ibmap_idx) {
 			memset(journal_buffer, '\0', fs->blksz);
-			status = ext4fs_devread(gd[ibmap_idx].inode_id
+			status = ext4fs_devread(bgd[ibmap_idx].inode_id
 						* fs->sect_perblk,
 						0, fs->blksz, journal_buffer);
 			if (status == 0)
 				goto fail;
 			if (ext4fs_log_journal(journal_buffer,
-						gd[ibmap_idx].inode_id))
+						bgd[ibmap_idx].inode_id))
 				goto fail;
 			prev_inode_bitmap_index = ibmap_idx;
 		}
-		if (gd[ibmap_idx].bg_itable_unused != gd[ibmap_idx].free_inodes)
-			gd[ibmap_idx].bg_itable_unused =
-					gd[ibmap_idx].free_inodes;
-		gd[ibmap_idx].free_inodes--;
-		gd[ibmap_idx].bg_itable_unused--;
+		if (bgd[ibmap_idx].bg_itable_unused !=
+				bgd[ibmap_idx].free_inodes)
+			bgd[ibmap_idx].bg_itable_unused =
+					bgd[ibmap_idx].free_inodes;
+		bgd[ibmap_idx].free_inodes--;
+		bgd[ibmap_idx].bg_itable_unused--;
 		fs->sb->free_inodes--;
 		goto success;
 	}
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
index 93dcb7e..3a5ef20 100644
--- a/fs/ext4/ext4fs.c
+++ b/fs/ext4/ext4fs.c
@@ -209,14 +209,14 @@
 
 	/* update block groups */
 	for (i = 0; i < fs->no_blkgrp; i++) {
-		fs->gd[i].bg_checksum = ext4fs_checksum_update(i);
-		put_ext4((uint64_t)(fs->gd[i].block_id * fs->blksz),
+		fs->bgd[i].bg_checksum = ext4fs_checksum_update(i);
+		put_ext4((uint64_t)(fs->bgd[i].block_id * fs->blksz),
 			 fs->blk_bmaps[i], fs->blksz);
 	}
 
 	/* update inode table groups */
 	for (i = 0; i < fs->no_blkgrp; i++) {
-		put_ext4((uint64_t) (fs->gd[i].inode_id * fs->blksz),
+		put_ext4((uint64_t) (fs->bgd[i].inode_id * fs->blksz),
 			 fs->inode_bmaps[i], fs->blksz);
 	}
 
@@ -266,7 +266,7 @@
 
 static void delete_single_indirect_block(struct ext2_inode *inode)
 {
-	struct ext2_block_group *gd = NULL;
+	struct ext2_block_group *bgd = NULL;
 	static int prev_bg_bmap_idx = -1;
 	long int blknr;
 	int remainder;
@@ -280,7 +280,7 @@
 		return;
 	}
 	/* get  block group descriptor table */
-	gd = (struct ext2_block_group *)fs->gdtable;
+	bgd = (struct ext2_block_group *)fs->gdtable;
 
 	/* deleting the single indirect block associated with inode */
 	if (inode->b.blocks.indir_block != 0) {
@@ -295,18 +295,18 @@
 				bg_idx--;
 		}
 		ext4fs_reset_block_bmap(blknr, fs->blk_bmaps[bg_idx], bg_idx);
-		gd[bg_idx].free_blocks++;
+		bgd[bg_idx].free_blocks++;
 		fs->sb->free_blocks++;
 		/* journal backup */
 		if (prev_bg_bmap_idx != bg_idx) {
 			status =
-			    ext4fs_devread(gd[bg_idx].block_id *
+			    ext4fs_devread(bgd[bg_idx].block_id *
 					   fs->sect_perblk, 0, fs->blksz,
 					   journal_buffer);
 			if (status == 0)
 				goto fail;
 			if (ext4fs_log_journal
-			    (journal_buffer, gd[bg_idx].block_id))
+			    (journal_buffer, bgd[bg_idx].block_id))
 				goto fail;
 			prev_bg_bmap_idx = bg_idx;
 		}
@@ -326,7 +326,7 @@
 	unsigned int blk_per_grp = ext4fs_root->sblock.blocks_per_group;
 	unsigned int *di_buffer = NULL;
 	unsigned int *DIB_start_addr = NULL;
-	struct ext2_block_group *gd = NULL;
+	struct ext2_block_group *bgd = NULL;
 	struct ext_filesystem *fs = get_fs();
 	char *journal_buffer = zalloc(fs->blksz);
 	if (!journal_buffer) {
@@ -334,7 +334,7 @@
 		return;
 	}
 	/* get the block group descriptor table */
-	gd = (struct ext2_block_group *)fs->gdtable;
+	bgd = (struct ext2_block_group *)fs->gdtable;
 
 	if (inode->b.blocks.double_indir_block != 0) {
 		di_buffer = zalloc(fs->blksz);
@@ -362,11 +362,11 @@
 			ext4fs_reset_block_bmap(*di_buffer,
 					fs->blk_bmaps[bg_idx], bg_idx);
 			di_buffer++;
-			gd[bg_idx].free_blocks++;
+			bgd[bg_idx].free_blocks++;
 			fs->sb->free_blocks++;
 			/* journal backup */
 			if (prev_bg_bmap_idx != bg_idx) {
-				status = ext4fs_devread(gd[bg_idx].block_id
+				status = ext4fs_devread(bgd[bg_idx].block_id
 							* fs->sect_perblk, 0,
 							fs->blksz,
 							journal_buffer);
@@ -374,7 +374,7 @@
 					goto fail;
 
 				if (ext4fs_log_journal(journal_buffer,
-							gd[bg_idx].block_id))
+							bgd[bg_idx].block_id))
 					goto fail;
 				prev_bg_bmap_idx = bg_idx;
 			}
@@ -391,19 +391,19 @@
 				bg_idx--;
 		}
 		ext4fs_reset_block_bmap(blknr, fs->blk_bmaps[bg_idx], bg_idx);
-		gd[bg_idx].free_blocks++;
+		bgd[bg_idx].free_blocks++;
 		fs->sb->free_blocks++;
 		/* journal backup */
 		if (prev_bg_bmap_idx != bg_idx) {
 			memset(journal_buffer, '\0', fs->blksz);
-			status = ext4fs_devread(gd[bg_idx].block_id *
+			status = ext4fs_devread(bgd[bg_idx].block_id *
 						fs->sect_perblk, 0, fs->blksz,
 						journal_buffer);
 			if (status == 0)
 				goto fail;
 
 			if (ext4fs_log_journal(journal_buffer,
-						gd[bg_idx].block_id))
+						bgd[bg_idx].block_id))
 				goto fail;
 			prev_bg_bmap_idx = bg_idx;
 		}
@@ -427,7 +427,7 @@
 	unsigned int *tib_start_addr = NULL;
 	unsigned int *tip_buffer = NULL;
 	unsigned int *tipb_start_addr = NULL;
-	struct ext2_block_group *gd = NULL;
+	struct ext2_block_group *bgd = NULL;
 	struct ext_filesystem *fs = get_fs();
 	char *journal_buffer = zalloc(fs->blksz);
 	if (!journal_buffer) {
@@ -435,7 +435,7 @@
 		return;
 	}
 	/* get block group descriptor table */
-	gd = (struct ext2_block_group *)fs->gdtable;
+	bgd = (struct ext2_block_group *)fs->gdtable;
 
 	if (inode->b.blocks.triple_indir_block != 0) {
 		tigp_buffer = zalloc(fs->blksz);
@@ -477,20 +477,21 @@
 							bg_idx);
 
 				tip_buffer++;
-				gd[bg_idx].free_blocks++;
+				bgd[bg_idx].free_blocks++;
 				fs->sb->free_blocks++;
 				/* journal backup */
 				if (prev_bg_bmap_idx != bg_idx) {
 					status =
-					    ext4fs_devread(gd[bg_idx].block_id *
-							   fs->sect_perblk, 0,
-							   fs->blksz,
-							   journal_buffer);
+					    ext4fs_devread(
+							bgd[bg_idx].block_id *
+							fs->sect_perblk, 0,
+							fs->blksz,
+							journal_buffer);
 					if (status == 0)
 						goto fail;
 
 					if (ext4fs_log_journal(journal_buffer,
-							       gd[bg_idx].
+							       bgd[bg_idx].
 							       block_id))
 						goto fail;
 					prev_bg_bmap_idx = bg_idx;
@@ -516,20 +517,20 @@
 						fs->blk_bmaps[bg_idx], bg_idx);
 
 			tigp_buffer++;
-			gd[bg_idx].free_blocks++;
+			bgd[bg_idx].free_blocks++;
 			fs->sb->free_blocks++;
 			/* journal backup */
 			if (prev_bg_bmap_idx != bg_idx) {
 				memset(journal_buffer, '\0', fs->blksz);
 				status =
-				    ext4fs_devread(gd[bg_idx].block_id *
+				    ext4fs_devread(bgd[bg_idx].block_id *
 						   fs->sect_perblk, 0,
 						   fs->blksz, journal_buffer);
 				if (status == 0)
 					goto fail;
 
 				if (ext4fs_log_journal(journal_buffer,
-							gd[bg_idx].block_id))
+							bgd[bg_idx].block_id))
 					goto fail;
 				prev_bg_bmap_idx = bg_idx;
 			}
@@ -546,19 +547,19 @@
 				bg_idx--;
 		}
 		ext4fs_reset_block_bmap(blknr, fs->blk_bmaps[bg_idx], bg_idx);
-		gd[bg_idx].free_blocks++;
+		bgd[bg_idx].free_blocks++;
 		fs->sb->free_blocks++;
 		/* journal backup */
 		if (prev_bg_bmap_idx != bg_idx) {
 			memset(journal_buffer, '\0', fs->blksz);
-			status = ext4fs_devread(gd[bg_idx].block_id *
+			status = ext4fs_devread(bgd[bg_idx].block_id *
 						fs->sect_perblk, 0, fs->blksz,
 						journal_buffer);
 			if (status == 0)
 				goto fail;
 
 			if (ext4fs_log_journal(journal_buffer,
-						gd[bg_idx].block_id))
+						bgd[bg_idx].block_id))
 				goto fail;
 			prev_bg_bmap_idx = bg_idx;
 		}
@@ -590,13 +591,13 @@
 	unsigned int blk_per_grp = ext4fs_root->sblock.blocks_per_group;
 	unsigned int inode_per_grp = ext4fs_root->sblock.inodes_per_group;
 	struct ext2_inode *inode_buffer = NULL;
-	struct ext2_block_group *gd = NULL;
+	struct ext2_block_group *bgd = NULL;
 	struct ext_filesystem *fs = get_fs();
 	char *journal_buffer = zalloc(fs->blksz);
 	if (!journal_buffer)
 		return -ENOMEM;
 	/* get the block group descriptor table */
-	gd = (struct ext2_block_group *)fs->gdtable;
+	bgd = (struct ext2_block_group *)fs->gdtable;
 	status = ext4fs_read_inode(ext4fs_root, inodeno, &inode);
 	if (status == 0)
 		goto fail;
@@ -631,19 +632,19 @@
 			debug("EXT4_EXTENTS Block releasing %ld: %d\n",
 			      blknr, bg_idx);
 
-			gd[bg_idx].free_blocks++;
+			bgd[bg_idx].free_blocks++;
 			fs->sb->free_blocks++;
 
 			/* journal backup */
 			if (prev_bg_bmap_idx != bg_idx) {
 				status =
-				    ext4fs_devread(gd[bg_idx].block_id *
+				    ext4fs_devread(bgd[bg_idx].block_id *
 						   fs->sect_perblk, 0,
 						   fs->blksz, journal_buffer);
 				if (status == 0)
 					goto fail;
 				if (ext4fs_log_journal(journal_buffer,
-							gd[bg_idx].block_id))
+							bgd[bg_idx].block_id))
 					goto fail;
 				prev_bg_bmap_idx = bg_idx;
 			}
@@ -676,19 +677,19 @@
 						bg_idx);
 			debug("ActualB releasing %ld: %d\n", blknr, bg_idx);
 
-			gd[bg_idx].free_blocks++;
+			bgd[bg_idx].free_blocks++;
 			fs->sb->free_blocks++;
 			/* journal backup */
 			if (prev_bg_bmap_idx != bg_idx) {
 				memset(journal_buffer, '\0', fs->blksz);
-				status = ext4fs_devread(gd[bg_idx].block_id
+				status = ext4fs_devread(bgd[bg_idx].block_id
 							* fs->sect_perblk,
 							0, fs->blksz,
 							journal_buffer);
 				if (status == 0)
 					goto fail;
 				if (ext4fs_log_journal(journal_buffer,
-						gd[bg_idx].block_id))
+						bgd[bg_idx].block_id))
 					goto fail;
 				prev_bg_bmap_idx = bg_idx;
 			}
@@ -701,7 +702,7 @@
 
 	/* get the block no */
 	inodeno--;
-	blkno = __le32_to_cpu(gd[ibmap_idx].inode_table_id) +
+	blkno = __le32_to_cpu(bgd[ibmap_idx].inode_table_id) +
 		(inodeno % __le32_to_cpu(inode_per_grp)) / inodes_per_block;
 
 	/* get the offset of the inode */
@@ -731,15 +732,15 @@
 	/* update the respective inode bitmaps */
 	inodeno++;
 	ext4fs_reset_inode_bmap(inodeno, fs->inode_bmaps[ibmap_idx], ibmap_idx);
-	gd[ibmap_idx].free_inodes++;
+	bgd[ibmap_idx].free_inodes++;
 	fs->sb->free_inodes++;
 	/* journal backup */
 	memset(journal_buffer, '\0', fs->blksz);
-	status = ext4fs_devread(gd[ibmap_idx].inode_id *
+	status = ext4fs_devread(bgd[ibmap_idx].inode_id *
 				fs->sect_perblk, 0, fs->blksz, journal_buffer);
 	if (status == 0)
 		goto fail;
-	if (ext4fs_log_journal(journal_buffer, gd[ibmap_idx].inode_id))
+	if (ext4fs_log_journal(journal_buffer, bgd[ibmap_idx].inode_id))
 		goto fail;
 
 	ext4fs_update();
@@ -797,7 +798,7 @@
 		printf("Error in getting the block group descriptor table\n");
 		goto fail;
 	}
-	fs->gd = (struct ext2_block_group *)fs->gdtable;
+	fs->bgd = (struct ext2_block_group *)fs->gdtable;
 
 	/* load all the available bitmap block of the partition */
 	fs->blk_bmaps = zalloc(fs->no_blkgrp * sizeof(char *));
@@ -811,7 +812,7 @@
 
 	for (i = 0; i < fs->no_blkgrp; i++) {
 		status =
-		    ext4fs_devread(fs->gd[i].block_id * fs->sect_perblk, 0,
+		    ext4fs_devread(fs->bgd[i].block_id * fs->sect_perblk, 0,
 				   fs->blksz, (char *)fs->blk_bmaps[i]);
 		if (status == 0)
 			goto fail;
@@ -828,7 +829,7 @@
 	}
 
 	for (i = 0; i < fs->no_blkgrp; i++) {
-		status = ext4fs_devread(fs->gd[i].inode_id * fs->sect_perblk,
+		status = ext4fs_devread(fs->bgd[i].inode_id * fs->sect_perblk,
 					0, fs->blksz,
 					(char *)fs->inode_bmaps[i]);
 		if (status == 0)
@@ -842,7 +843,7 @@
 	 * reboot of a linux kernel
 	 */
 	for (i = 0; i < fs->no_blkgrp; i++)
-		real_free_blocks = real_free_blocks + fs->gd[i].free_blocks;
+		real_free_blocks = real_free_blocks + fs->bgd[i].free_blocks;
 	if (real_free_blocks != fs->sb->free_blocks)
 		fs->sb->free_blocks = real_free_blocks;
 
@@ -907,7 +908,7 @@
 
 	free(fs->gdtable);
 	fs->gdtable = NULL;
-	fs->gd = NULL;
+	fs->bgd = NULL;
 	/*
 	 * reinitiliazed the global inode and
 	 * block bitmap first execution check variables
@@ -1087,7 +1088,7 @@
 		goto fail;
 	ibmap_idx = inodeno / ext4fs_root->sblock.inodes_per_group;
 	inodeno--;
-	itable_blkno = __le32_to_cpu(fs->gd[ibmap_idx].inode_table_id) +
+	itable_blkno = __le32_to_cpu(fs->bgd[ibmap_idx].inode_table_id) +
 			(inodeno % __le32_to_cpu(sblock->inodes_per_group)) /
 			inodes_per_block;
 	blkoff = (inodeno % inodes_per_block) * fs->inodesz;
@@ -1105,7 +1106,7 @@
 	}
 	ibmap_idx = parent_inodeno / ext4fs_root->sblock.inodes_per_group;
 	parent_inodeno--;
-	parent_itable_blkno = __le32_to_cpu(fs->gd[ibmap_idx].inode_table_id) +
+	parent_itable_blkno = __le32_to_cpu(fs->bgd[ibmap_idx].inode_table_id) +
 	    (parent_inodeno %
 	     __le32_to_cpu(sblock->inodes_per_group)) / inodes_per_block;
 	blkoff = (parent_inodeno % inodes_per_block) * fs->inodesz;
