* [PATCH 1/1] ext4: fix incorrect function call when initializing s_resgid
@ 2026-07-27 10:41 Jiazi Liu
2026-07-28 4:40 ` Ritesh Harjani
2026-08-06 15:00 ` Theodore Ts'o
0 siblings, 2 replies; 4+ messages in thread
From: Jiazi Liu @ 2026-07-27 10:41 UTC (permalink / raw)
To: tytso; +Cc: adilger.kernel, linux-ext4, linux-kernel, stable, Jiazi Liu
In __ext4_fill_super(), s_resgid is initialized by calling
ext4_get_resuid() instead of ext4_get_resgid(), resulting in the
reserved GID being set to the same value as the reserved UID rather
than the value stored in the superblock.
Fixes: 12c84dd4d308 ("ext4: add support for 32-bit default reserved uid and gid values")
Cc: stable@vger.kernel.org
Signed-off-by: Jiazi Liu <liujiazi@amazon.com>
---
fs/ext4/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6c18b5adffca..a187112cafaf 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5380,7 +5380,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
ext4_set_def_opts(sb, es);
sbi->s_resuid = make_kuid(&init_user_ns, ext4_get_resuid(es));
- sbi->s_resgid = make_kgid(&init_user_ns, ext4_get_resuid(es));
+ sbi->s_resgid = make_kgid(&init_user_ns, ext4_get_resgid(es));
sbi->s_commit_interval = JBD2_DEFAULT_MAX_COMMIT_AGE * HZ;
sbi->s_min_batch_time = EXT4_DEF_MIN_BATCH_TIME;
sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME;
--
2.50.1 (Apple Git-155)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] ext4: fix incorrect function call when initializing s_resgid
2026-07-27 10:41 [PATCH 1/1] ext4: fix incorrect function call when initializing s_resgid Jiazi Liu
@ 2026-07-28 4:40 ` Ritesh Harjani
2026-07-29 3:31 ` Liu Jiazi
2026-08-06 15:00 ` Theodore Ts'o
1 sibling, 1 reply; 4+ messages in thread
From: Ritesh Harjani @ 2026-07-28 4:40 UTC (permalink / raw)
To: Jiazi Liu, tytso
Cc: adilger.kernel, linux-ext4, linux-kernel, stable, Jiazi Liu
Jiazi Liu <jiazi.liu1984@gmail.com> writes:
> In __ext4_fill_super(), s_resgid is initialized by calling
> ext4_get_resuid() instead of ext4_get_resgid(), resulting in the
> reserved GID being set to the same value as the reserved UID rather
> than the value stored in the superblock.
>
> Fixes: 12c84dd4d308 ("ext4: add support for 32-bit default reserved uid and gid values")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiazi Liu <liujiazi@amazon.com>
yup, that clearly looks like a simple miss.
Nice catch! Wondering whether this was caught by code review or did you
hit an issue due to this?
Looks good to me. Feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] ext4: fix incorrect function call when initializing s_resgid
2026-07-28 4:40 ` Ritesh Harjani
@ 2026-07-29 3:31 ` Liu Jiazi
0 siblings, 0 replies; 4+ messages in thread
From: Liu Jiazi @ 2026-07-29 3:31 UTC (permalink / raw)
To: Ritesh Harjani
Cc: tytso, adilger.kernel, linux-ext4, linux-kernel, stable, Jiazi Liu
Thanks for the review.
This was actually caught in our product. We use gid as the reserve
size id, and we hit this issue there.
Brs
Jiazi
Ritesh Harjani <ritesh.list@gmail.com> 于2026年7月28日周二 12:43写道:
>
> Jiazi Liu <jiazi.liu1984@gmail.com> writes:
>
> > In __ext4_fill_super(), s_resgid is initialized by calling
> > ext4_get_resuid() instead of ext4_get_resgid(), resulting in the
> > reserved GID being set to the same value as the reserved UID rather
> > than the value stored in the superblock.
> >
> > Fixes: 12c84dd4d308 ("ext4: add support for 32-bit default reserved uid and gid values")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Jiazi Liu <liujiazi@amazon.com>
>
> yup, that clearly looks like a simple miss.
>
> Nice catch! Wondering whether this was caught by code review or did you
> hit an issue due to this?
>
> Looks good to me. Feel free to add:
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] ext4: fix incorrect function call when initializing s_resgid
2026-07-27 10:41 [PATCH 1/1] ext4: fix incorrect function call when initializing s_resgid Jiazi Liu
2026-07-28 4:40 ` Ritesh Harjani
@ 2026-08-06 15:00 ` Theodore Ts'o
1 sibling, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2026-08-06 15:00 UTC (permalink / raw)
To: Jiazi Liu
Cc: Theodore Ts'o, adilger.kernel, linux-ext4, linux-kernel,
stable, Jiazi Liu
On Mon, 27 Jul 2026 18:41:03 +0800, Jiazi Liu wrote:
> In __ext4_fill_super(), s_resgid is initialized by calling
> ext4_get_resuid() instead of ext4_get_resgid(), resulting in the
> reserved GID being set to the same value as the reserved UID rather
> than the value stored in the superblock.
Applied, thanks!
[1/1] ext4: fix incorrect function call when initializing s_resgid
commit: c87abbab6147dcc5aa1fd8f2a61734d58d8b99ec
Best regards,
--
Theodore Ts'o <tytso@mit.edu>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-06 15:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-27 10:41 [PATCH 1/1] ext4: fix incorrect function call when initializing s_resgid Jiazi Liu
2026-07-28 4:40 ` Ritesh Harjani
2026-07-29 3:31 ` Liu Jiazi
2026-08-06 15:00 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®