Skip to content

Commit eefc132

Browse files
Eric Sandeenbrauner
authored andcommitted
hugetlbfs: 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 6b5732b commit eefc132

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

fs/hugetlbfs/inode.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ enum hugetlb_param {
7373
};
7474

7575
static const struct fs_parameter_spec hugetlb_fs_parameters[] = {
76-
fsparam_u32 ("gid", Opt_gid),
76+
fsparam_gid ("gid", Opt_gid),
7777
fsparam_string("min_size", Opt_min_size),
7878
fsparam_u32oct("mode", Opt_mode),
7979
fsparam_string("nr_inodes", Opt_nr_inodes),
8080
fsparam_string("pagesize", Opt_pagesize),
8181
fsparam_string("size", Opt_size),
82-
fsparam_u32 ("uid", Opt_uid),
82+
fsparam_uid ("uid", Opt_uid),
8383
{}
8484
};
8585

@@ -1376,15 +1376,11 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par
13761376

13771377
switch (opt) {
13781378
case Opt_uid:
1379-
ctx->uid = make_kuid(current_user_ns(), result.uint_32);
1380-
if (!uid_valid(ctx->uid))
1381-
goto bad_val;
1379+
ctx->uid = result.uid;
13821380
return 0;
13831381

13841382
case Opt_gid:
1385-
ctx->gid = make_kgid(current_user_ns(), result.uint_32);
1386-
if (!gid_valid(ctx->gid))
1387-
goto bad_val;
1383+
ctx->gid = result.gid;
13881384
return 0;
13891385

13901386
case Opt_mode:

0 commit comments

Comments
 (0)