From: Theodore Ts'o <tytso@mit.edu>
To: "Andreas Schrägle" <andreas@schraegle.name>
Cc: linux-ext4@vger.kernel.org
Subject: Re: resize2fs segfault
Date: Wed, 10 Aug 2016 16:01:13 -0400 [thread overview]
Message-ID: <20160810200113.GA10523@thunk.org> (raw)
In-Reply-To: <20160809214157.091c200a@schraegle.name>
On Tue, Aug 09, 2016 at 09:41:57PM +0700, Andreas Schrägle wrote:
>
> I seem to have run in a segmentation fault bug in resize2fs.
>
Thanks for the bug report! I found the problem and the patch will be
in the next version of e2fsprogs. It should fairly simple to apply
this patch to e2fsprogs 1.43.1 and rebuild it.
Cheers,
- Ted
commit 3d6fc974831a360aee460e54c442538445f3017c
Author: Theodore Ts'o <tytso@mit.edu>
Date: Wed Aug 10 15:49:35 2016 -0400
resize2fs: fix crash when there is an ea block and no blocks to migrate
This fixes a bug introduced in 1.43 by commit fb47b94fffc: "resize2fs:
rewrite extent/dir/ea block checksums when migrating". If there is an
extended attribute block and there are no blocks that need to migrate,
we will crash.
The bug was caused by a botched De Morgan's transformation.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 09419ce..8f6d95e 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -1895,7 +1895,7 @@ static errcode_t migrate_ea_block(ext2_resize_t rfs, ext2_ino_t ino,
errcode_t err = 0;
/* No EA block or no remapping? Quit early. */
- if (ext2fs_file_acl_block(rfs->old_fs, inode) == 0 && !rfs->bmap)
+ if (ext2fs_file_acl_block(rfs->old_fs, inode) == 0 || !rfs->bmap)
return 0;
new_block = extent_translate(rfs->old_fs, rfs->bmap,
ext2fs_file_acl_block(rfs->old_fs, inode));
parent reply other threads:[~2016-08-10 20:01 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20160809214157.091c200a@schraegle.name>]
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=20160810200113.GA10523@thunk.org \
--to=tytso@mit.edu \
--cc=andreas@schraegle.name \
--cc=linux-ext4@vger.kernel.org \
/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).