Skip to contentSkip to conversation

ext4: fix incorrect function call when initializing s_resgid

PATCH Applied Jiazi Liu 3 participants 4 messages Jul 27 – Aug 6

Subsystems (2)
lore
Share & tools
lore

Jiazi Liu

author
#0 lore raw

PATCH 1/1 ext4: fix incorrect function call when initializing s_resgid

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")
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
index 6c18b5adffca..a187112cafaf 100644
@@ -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;
Signature · 1 line
2.50.1 (Apple Git-155)
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · 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")

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:

author
#2 lore raw

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

Quoted 20 lines · Ritesh Harjani <[email protected]> 于2026年7月28日周二 12:43写道:
Quoted 8 lines · 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")

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:

maintainer Applied
#3 lore raw
In reply to Jiazi Liu
Quoted 4 lines · 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.

Applied, thanks!

[1/1] ext4: fix incorrect function call when initializing s_resgid

      commit: c87abbab6147dcc5aa1fd8f2a61734d58d8b99ec

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>