Commit eefc1324 authored by Eric Sandeen's avatar Eric Sandeen Committed by Christian Brauner

hugetlbfs: Convert to new uid/gid option parsing helpers

Convert to new uid/gid option parsing helpers
Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Link: https://lore.kernel.org/r/6cb0dcfd-f837-463f-b5ec-0e7d2608b837@redhat.comSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 6b5732b5
...@@ -73,13 +73,13 @@ enum hugetlb_param { ...@@ -73,13 +73,13 @@ enum hugetlb_param {
}; };
static const struct fs_parameter_spec hugetlb_fs_parameters[] = { static const struct fs_parameter_spec hugetlb_fs_parameters[] = {
fsparam_u32 ("gid", Opt_gid), fsparam_gid ("gid", Opt_gid),
fsparam_string("min_size", Opt_min_size), fsparam_string("min_size", Opt_min_size),
fsparam_u32oct("mode", Opt_mode), fsparam_u32oct("mode", Opt_mode),
fsparam_string("nr_inodes", Opt_nr_inodes), fsparam_string("nr_inodes", Opt_nr_inodes),
fsparam_string("pagesize", Opt_pagesize), fsparam_string("pagesize", Opt_pagesize),
fsparam_string("size", Opt_size), fsparam_string("size", Opt_size),
fsparam_u32 ("uid", Opt_uid), fsparam_uid ("uid", Opt_uid),
{} {}
}; };
...@@ -1376,15 +1376,11 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par ...@@ -1376,15 +1376,11 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par
switch (opt) { switch (opt) {
case Opt_uid: case Opt_uid:
ctx->uid = make_kuid(current_user_ns(), result.uint_32); ctx->uid = result.uid;
if (!uid_valid(ctx->uid))
goto bad_val;
return 0; return 0;
case Opt_gid: case Opt_gid:
ctx->gid = make_kgid(current_user_ns(), result.uint_32); ctx->gid = result.gid;
if (!gid_valid(ctx->gid))
goto bad_val;
return 0; return 0;
case Opt_mode: case Opt_mode:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment