From: Theodore Ts'o <tytso@mit.edu>
To: linux-ext4@vger.kernel.org
Cc: sandeen@redhat.com, Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 3/3] resize2fs: Fix corruption bug impacting ext4 filesystems with uninit_bg
Date: Sat, 18 Apr 2009 23:03:48 -0400 [thread overview]
Message-ID: <1240110228-22781-4-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1240110228-22781-3-git-send-email-tytso@mit.edu>
Due to a fencepost bug, when skipping a block group whose block bitmap
was uninitialized (and hence could not contain any blocks eligible for
relaocation), the block immediately following the block group wasn't
checked as well. If it was in use and required relocation, it
wouldn't get properly relocated, with the result that an inode using
such a block would end up, post resize, with a pointer to a block now
outside the bounds of the filesystem.
This commit fixes this fencepost error.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
resize/resize2fs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index ac926ce..f3e7fd0 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -804,7 +804,7 @@ static errcode_t blocks_to_move(ext2_resize_t rfs)
* to the next block group.
*/
blk = ((g+1) * fs->super->s_blocks_per_group) +
- fs->super->s_first_data_block;
+ fs->super->s_first_data_block - 1;
continue;
}
if (ext2fs_test_block_bitmap(old_fs->block_map, blk) &&
--
1.5.6.3
next prev parent reply other threads:[~2009-04-19 3:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-19 3:03 [PATCH 0/3] Fix resize2fs data/filesystem corruption bugs Theodore Ts'o
2009-04-19 3:03 ` [PATCH 1/3] resize2fs: Fix data corruption bug when growing an ext4 filesystem off-line Theodore Ts'o
2009-04-19 3:03 ` [PATCH 2/3] resize2fs: Fix data corruption bug when shrinking the inode table for ext4 Theodore Ts'o
2009-04-19 3:03 ` Theodore Ts'o [this message]
2009-04-21 23:57 ` [PATCH 0/3] Fix resize2fs data/filesystem corruption bugs Eric Sandeen
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=1240110228-22781-4-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).