public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric Bohé" <frederic.bohe@bull.net>
To: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: [PATCH] ext4: fix online resize group descriptors corruption
Date: Thu, 12 Jun 2008 11:42:34 +0200	[thread overview]
Message-ID: <1213263754.6549.45.camel@localhost> (raw)

From: Frederic Bohe <frederic.bohe@bull.net>

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.

Signed-off-by: Frederic Bohe <frederic.bohe@bull.net>
---
URL for the discussion about this issue: http://article.gmane.org/gmane.comp.file-systems.ext4/7226

The patch has been tested with linux-2.6.26-rc4-ext4-1 and
e2fsprogs-git-master-2008-06-07-365857912e27914afa8857af5adf74ee19ca9e03
under kvm and loopback device and without mballoc.

It has also been tested with linux-2.6.26-rc5, 
ext4-patch-queue-f245e945ae491e7931076706217b63d4bf0b5a1b
and e2fsprogs-365857912e27914afa8857af5adf74ee19ca9e03
with a physical hard disk and without mballoc

The patch does not correct the mballoc case (Oops in ext4_mb_release).
There is still an issue when resizing a flex_bg filesystem.

 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 *)(
+	       (__u8 *)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 */





             reply	other threads:[~2008-06-12  9:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12  9:42 Frédéric Bohé [this message]
2008-06-12 10:59 ` [PATCH] ext4: fix online resize group descriptors corruption Andreas Dilger
2008-06-12 13:35   ` [PATCH v2] " Frédéric Bohé
2008-06-12 14:14     ` [PATCH v3] " Frédéric Bohé
2008-06-12 14:56   ` [PATCH] " Jean-Pierre Dion
2008-06-12 19:04 ` Theodore Tso
2008-06-13 12:33   ` Frédéric Bohé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1213263754.6549.45.camel@localhost \
    --to=frederic.bohe@bull.net \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox