* [PATCH] ext4: recalculate s_blockfile_groups during resize2fs
@ 2013-05-03 21:06 Eric Sandeen
2013-05-06 0:36 ` Lachlan McIlroy
2013-05-06 3:06 ` Theodore Ts'o
0 siblings, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2013-05-03 21:06 UTC (permalink / raw)
To: ext4 development; +Cc: Lachlan McIlroy
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. */
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ext4: recalculate s_blockfile_groups during resize2fs
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
2013-05-06 3:06 ` Theodore Ts'o
1 sibling, 1 reply; 5+ messages in thread
From: Lachlan McIlroy @ 2013-05-06 0:36 UTC (permalink / raw)
To: Eric Sandeen; +Cc: ext4 development
----- 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ext4: recalculate s_blockfile_groups during resize2fs
2013-05-06 0:36 ` Lachlan McIlroy
@ 2013-05-06 2:08 ` Eric Sandeen
0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2013-05-06 2:08 UTC (permalink / raw)
To: Lachlan McIlroy; +Cc: ext4 development
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ext4: recalculate s_blockfile_groups during resize2fs
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 3:06 ` Theodore Ts'o
2013-05-06 3:31 ` Eric Sandeen
1 sibling, 1 reply; 5+ messages in thread
From: Theodore Ts'o @ 2013-05-06 3:06 UTC (permalink / raw)
To: Eric Sandeen; +Cc: ext4 development, Lachlan McIlroy
On Fri, May 03, 2013 at 04:06:56PM -0500, Eric Sandeen wrote:
> 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>
I sent out a patch about two weeks ago, which has since been accepted
into Linus's tree as commit c5c72d814cf0. It's been marked for the
for backporting into the stable trees.
Cheers,
- Ted
commit c5c72d814cf0f650010337c73638b25e6d14d2d4
Author: Theodore Ts'o <tytso@mit.edu>
Date: Sun Apr 21 20:19:43 2013 -0400
ext4: fix online resizing for ext3-compat file systems
Commit fb0a387dcdc restricts block allocations for indirect-mapped
files to block groups less than s_blockfile_groups. However, the
online resizing code wasn't setting s_blockfile_groups, so the newly
added block groups were not available for non-extent mapped files.
Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ext4: recalculate s_blockfile_groups during resize2fs
2013-05-06 3:06 ` Theodore Ts'o
@ 2013-05-06 3:31 ` Eric Sandeen
0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2013-05-06 3:31 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Eric Sandeen, ext4 development, Lachlan McIlroy
On May 5, 2013, at 10:06 PM, "Theodore Ts'o" <tytso@mit.edu> wrote:
> On Fri, May 03, 2013 at 04:06:56PM -0500, Eric Sandeen wrote:
>> 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>
>
> I sent out a patch about two weeks ago, which has since been accepted
> into Linus's tree as commit c5c72d814cf0. It's been marked for the
> for backporting into the stable trees.
>
Argh, so you did! One demerit for me for forgetting, and another for patching an old tree....
Thanks,
Eric
> Cheers,
>
> - Ted
>
> commit c5c72d814cf0f650010337c73638b25e6d14d2d4
> Author: Theodore Ts'o <tytso@mit.edu>
> Date: Sun Apr 21 20:19:43 2013 -0400
>
> ext4: fix online resizing for ext3-compat file systems
>
> Commit fb0a387dcdc restricts block allocations for indirect-mapped
> files to block groups less than s_blockfile_groups. However, the
> online resizing code wasn't setting s_blockfile_groups, so the newly
> added block groups were not available for non-extent mapped files.
>
> Reported-by: Eric Sandeen <sandeen@redhat.com>
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> Cc: stable@vger.kernel.org
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-06 3:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-05-06 3:06 ` Theodore Ts'o
2013-05-06 3:31 ` Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox