From: Eric Sandeen <sandeen@redhat.com>
To: Lachlan McIlroy <lmcilroy@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: recalculate s_blockfile_groups during resize2fs
Date: Sun, 05 May 2013 21:08:14 -0500 [thread overview]
Message-ID: <5187108E.5000105@redhat.com> (raw)
In-Reply-To: <1822783755.19193156.1367800576698.JavaMail.root@redhat.com>
On 5/5/13 7:36 PM, Lachlan McIlroy wrote:
> ----- Original Message -----
>> s_blockfile_groups is used to limit allocations for non-extent
>> files to block groups with block numbers less than 2^32.
>> However, it's not updated when the filesystem is resized online,
>> so the new groups are unavailable to non-extent files until a remount.
>>
>> Fix this by updating the value in ext4_update_super() at
>> resize time.
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
>> diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
>> index c169477..1357260 100644
>> --- a/fs/ext4/resize.c
>> +++ b/fs/ext4/resize.c
>> @@ -1341,6 +1341,8 @@ static void ext4_update_super(struct super_block *sb,
>>
>> /* Update the global fs size fields */
>> sbi->s_groups_count += flex_gd->count;
>> + sbi->s_blockfile_groups = min_t(ext4_group_t, sbi->s_groups_count,
>> + (EXT4_MAX_BLOCK_FILE_PHYS / EXT4_BLOCKS_PER_GROUP(sb)));
>>
>> /* Update the reserved block counts only once the new group is
>> * active. */
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> Good catch Eric - this would have prevented the bug in
> ext4_mb_regular_allocator() too. Looks good to me.
Yep - at least until the filesystem grows > 16TB :)
-Eric
next prev parent reply other threads:[~2013-05-06 2:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-03 21:06 [PATCH] ext4: recalculate s_blockfile_groups during resize2fs Eric Sandeen
2013-05-06 0:36 ` Lachlan McIlroy
2013-05-06 2:08 ` Eric Sandeen [this message]
2013-05-06 3:06 ` Theodore Ts'o
2013-05-06 3:31 ` 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=5187108E.5000105@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=lmcilroy@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