Skip to contentSkip to conversation

EXT4: fix online resize bug

PATCH In review Josef Bacik 2 participants 2 messages May 29, 2008 – Jun 5, 2008 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 EXT4: fix online resize bug

Hello,

There is a bug when we are trying to verify that the reserve inode's double indirect blocks point back to the primary gdt blocks. The fix is obvious, we need to mod the gdb count by the addr's per block. This was verified using the same testcase as with the ext3 equivalent of this patch. Thank you,

fs/ext4/resize.c +2 -1
Index: linux-2.6/fs/ext4/resize.c
===================================================================
@@ -563,7 +563,8 @@ static int reserve_backup_gdb(handle_t *
 	}
 
 	blk = EXT4_SB(sb)->s_sbh->b_blocknr + 1 + EXT4_SB(sb)->s_gdb_count;
-	data = (__le32 *)dind->b_data + EXT4_SB(sb)->s_gdb_count;
+	data = (__le32 *)dind->b_data + (EXT4_SB(sb)->s_gdb_count %
+					 EXT4_ADDR_PER_BLOCK(sb));
 	end = (__le32 *)dind->b_data + EXT4_ADDR_PER_BLOCK(sb);
 
 	/* Get each reserved primary GDT block and verify it holds backups */
maintainer
#1 lore raw
Quoted 8 lines · Josef Bacik

Hello,

There is a bug when we are trying to verify that the reserve inode's double indirect blocks point back to the primary gdt blocks. The fix is obvious, we need to mod the gdb count by the addr's per block. This was verified using the same testcase as with the ext3 equivalent of this patch. Thank you,

- Ted