Skip to content

Commit 2ec0701

Browse files
Eric Sandeenbrauner
authored andcommitted
tmpfs: Convert to new uid/gid option parsing helpers
Convert to new uid/gid option parsing helpers Signed-off-by: Eric Sandeen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent c449cb5 commit 2ec0701

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

mm/shmem.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3903,14 +3903,14 @@ static const struct constant_table shmem_param_enums_huge[] = {
39033903
};
39043904

39053905
const struct fs_parameter_spec shmem_fs_parameters[] = {
3906-
fsparam_u32 ("gid", Opt_gid),
3906+
fsparam_gid ("gid", Opt_gid),
39073907
fsparam_enum ("huge", Opt_huge, shmem_param_enums_huge),
39083908
fsparam_u32oct("mode", Opt_mode),
39093909
fsparam_string("mpol", Opt_mpol),
39103910
fsparam_string("nr_blocks", Opt_nr_blocks),
39113911
fsparam_string("nr_inodes", Opt_nr_inodes),
39123912
fsparam_string("size", Opt_size),
3913-
fsparam_u32 ("uid", Opt_uid),
3913+
fsparam_uid ("uid", Opt_uid),
39143914
fsparam_flag ("inode32", Opt_inode32),
39153915
fsparam_flag ("inode64", Opt_inode64),
39163916
fsparam_flag ("noswap", Opt_noswap),
@@ -3970,9 +3970,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
39703970
ctx->mode = result.uint_32 & 07777;
39713971
break;
39723972
case Opt_uid:
3973-
kuid = make_kuid(current_user_ns(), result.uint_32);
3974-
if (!uid_valid(kuid))
3975-
goto bad_value;
3973+
kuid = result.uid;
39763974

39773975
/*
39783976
* The requested uid must be representable in the
@@ -3984,9 +3982,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
39843982
ctx->uid = kuid;
39853983
break;
39863984
case Opt_gid:
3987-
kgid = make_kgid(current_user_ns(), result.uint_32);
3988-
if (!gid_valid(kgid))
3989-
goto bad_value;
3985+
kgid = result.gid;
39903986

39913987
/*
39923988
* The requested gid must be representable in the

0 commit comments

Comments
 (0)