2008-06-09 23:50:45

by Andrew Morton

[permalink] [raw]
Subject: [patch (for 2.6.26?) 1/1] ext4: fix online resize bug

From: Josef Bacik <[email protected]>

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.

Signed-off-by: Josef Bacik <[email protected]>
Cc: <[email protected]>
Acked-by: Andreas Dilger <[email protected]>
Cc: Mingming Cao <[email protected]>
Acked-by: Theodore Ts'o <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

fs/ext4/resize.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/ext4/resize.c~ext4-fix-online-resize-bug fs/ext4/resize.c
--- a/fs/ext4/resize.c~ext4-fix-online-resize-bug
+++ a/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 */
_


2008-06-10 14:18:04

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [patch (for 2.6.26?) 1/1] ext4: fix online resize bug

It's harmless to push to -stable, but online resize for ext4 is so badly broken that this patch is the least of 2.26.26's problems, and in fact I wonder how Josef could have possibly tested it.

Still, the patch in question does fix a real bug.

-Ted

------Original Message------
From: [email protected]
To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Sent: Jun 9, 2008 7:49 PM
Subject: [patch (for 2.6.26?) 1/1] ext4: fix online resize bug

From: Josef Bacik <[email protected]>

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.

Signed-off-by: Josef Bacik <[email protected]>
Cc: <[email protected]>
Acked-by: Andreas Dilger <[email protected]>
Cc: Mingming Cao <[email protected]>
Acked-by: Theodore Ts'o <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

fs/ext4/resize.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/ext4/resize.c~ext4-fix-online-resize-bug fs/ext4/resize.c
--- a/fs/ext4/resize.c~ext4-fix-online-resize-bug
+++ a/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 */
_