From: Theodore Ts'o <tytso@mit.edu>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] e2fsprogs: allocate inode table wholly within group
Date: Mon, 30 Sep 2013 21:57:46 -0400 [thread overview]
Message-ID: <20131001015746.GF5845@thunk.org> (raw)
In-Reply-To: <51DB2EB9.4010903@redhat.com>
On Mon, Jul 08, 2013 at 04:27:21PM -0500, Eric Sandeen wrote:
>
> The actual problem seems to be that the test does successive "-M" minimal resizes, and eventually we resize into the middle of an inode table, leaving the end of the table beyond the fs.
>
> Point "resize2fs -M" at the attached image once or twice w/ fscks in between and you should see it.
I've been going through my patch backlog, so I finally had a chance to
take a very close look at your test image. I now understand why
things are failing.
1) The test image (which you said was generated on a ppc e2fsprogs?)
was doing something very weird as far as the location of the
allocation bitmaps and inode table:
Filesystem features: ext_attr dir_index filetype sparse_super
Inode count: 512
Block count: 1247
...
Group 0: (Blocks 1-1024)
Primary superblock at 1, Group descriptors at 2-2
Block bitmap at 66 (+65), Inode bitmap at 67 (+66)
Inode table at 68-99 (+67)
Group 1: (Blocks 1025-1246)
Backup superblock at 1025, Group descriptors at 1026-1026
Block bitmap at 1090 (+65), Inode bitmap at 1091 (+66)
Inode table at 1092-1123 (+67)
Compare and contrast this with what x86 and Debian's ppc mke2fs creates:
Group 0: (Blocks 1-1024)
Primary superblock at 1, Group descriptors at 2-2
Block bitmap at 3 (+2), Inode bitmap at 4 (+3)
Inode table at 5-14 (+4)
Group 1: (Blocks 1025-1246)
Backup superblock at 1025, Group descriptors at 1026-1026
Block bitmap at 1027 (+2), Inode bitmap at 1028 (+3)
Inode table at 1029-1038 (+4)
So I'm not sure why Fedora's ppc mke2fs is creating file systems in
this way, but that's one of the causes of the bug.
2) The second cause of the bug is that
calculate_minimum_resize_size(), when we calculate the number of
blocks for the last group, the code has an implicit assumption that
the metadata blocks are located at the very beginning of the block
group. That's an easy fix.
> It seems like the obvious fix would be to move the inode table if
> necessary, as with the following patch.
Your patch is a good one, but at least in the context of resize2fs -M,
we should be fixing calculate_minimum_resize_size() so we can avoid
needing to move the inode table (since even if it can succeed, it's
not worth the danger).
I'll send out some patches to address this. Thanks for sending the
test image; and my apologies for not having time to get back to this
until now.
- Ted
next prev parent reply other threads:[~2013-10-01 1:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 19:14 [PATCH] e2fsprogs: allocate inode table wholly within group Eric Sandeen
2013-07-04 14:19 ` [PATCH] e2fsprogs FTBFS: " Eric Sandeen
2013-07-07 15:53 ` [PATCH] e2fsprogs: " Theodore Ts'o
2013-07-07 23:34 ` Theodore Ts'o
2013-07-08 1:59 ` Eric Sandeen
2013-07-08 18:34 ` Eric Sandeen
2013-07-08 21:27 ` Eric Sandeen
2013-10-01 1:57 ` Theodore Ts'o [this message]
2013-10-01 3:59 ` [PATCH 1/4] resize2fs: add debugging support for resize2fs -M calcuations Theodore Ts'o
2013-10-01 3:59 ` [PATCH 2/4] resize2fs: fix -M size calculations to avoid cutting off the inode table Theodore Ts'o
2013-10-01 3:59 ` [PATCH 3/4] resize2fs: relocate inode table blocks if necessary when shrinking Theodore Ts'o
2013-10-01 3:59 ` [PATCH 4/4] tests: add test for resize2fs -M with inode table in middle of block group Theodore Ts'o
2013-10-01 15:26 ` [PATCH] e2fsprogs: allocate inode table wholly within group Eric Sandeen
2013-10-01 15:35 ` Eric Sandeen
2013-10-01 16:29 ` 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=20131001015746.GF5845@thunk.org \
--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).