Re: [PATCH v3] ext4: fix online resize group descriptors corruption

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

 



There was a tab issue in the v2 patch, sorry for the spam...

From: Frederic Bohe <frederic.bohe@xxxxxxxx>

This is the patch for the group descriptor table corruption during
online resize pointed out by Theodore Tso.
The issue was due to the ext4 group descriptor which can be either
32 or 64 bytes long.
Only the 64 bytes structure was taken into account.t. 

Signed-off-by: Frederic Bohe <frederic.bohe@xxxxxxxx>
---
 resize.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -rup a/fs/ext4/resize.c b/fs/ext4/resize.c
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -855,7 +855,8 @@ int ext4_group_add(struct super_block *s
 	 */
 
 	/* Update group descriptor block for new group */
-	gdp = (struct ext4_group_desc *)primary->b_data + gdb_off;
+	gdp = (struct ext4_group_desc *)((char *)primary->b_data +
+					 gdb_off * EXT4_DESC_SIZE(sb));
 
 	ext4_block_bitmap_set(sb, gdp, input->block_bitmap); /* LV FIXME */
 	ext4_inode_bitmap_set(sb, gdp, input->inode_bitmap); /* LV FIXME */




--
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