Commit 2ec07010 authored by Eric Sandeen's avatar Eric Sandeen Committed by Christian Brauner

tmpfs: 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/06b54c7c-4f08-4d99-93d1-32b9f6706209@redhat.comSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent c449cb5d
...@@ -3903,14 +3903,14 @@ static const struct constant_table shmem_param_enums_huge[] = { ...@@ -3903,14 +3903,14 @@ static const struct constant_table shmem_param_enums_huge[] = {
}; };
const struct fs_parameter_spec shmem_fs_parameters[] = { const struct fs_parameter_spec shmem_fs_parameters[] = {
fsparam_u32 ("gid", Opt_gid), fsparam_gid ("gid", Opt_gid),
fsparam_enum ("huge", Opt_huge, shmem_param_enums_huge), fsparam_enum ("huge", Opt_huge, shmem_param_enums_huge),
fsparam_u32oct("mode", Opt_mode), fsparam_u32oct("mode", Opt_mode),
fsparam_string("mpol", Opt_mpol), fsparam_string("mpol", Opt_mpol),
fsparam_string("nr_blocks", Opt_nr_blocks), fsparam_string("nr_blocks", Opt_nr_blocks),
fsparam_string("nr_inodes", Opt_nr_inodes), fsparam_string("nr_inodes", Opt_nr_inodes),
fsparam_string("size", Opt_size), fsparam_string("size", Opt_size),
fsparam_u32 ("uid", Opt_uid), fsparam_uid ("uid", Opt_uid),
fsparam_flag ("inode32", Opt_inode32), fsparam_flag ("inode32", Opt_inode32),
fsparam_flag ("inode64", Opt_inode64), fsparam_flag ("inode64", Opt_inode64),
fsparam_flag ("noswap", Opt_noswap), fsparam_flag ("noswap", Opt_noswap),
...@@ -3970,9 +3970,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param) ...@@ -3970,9 +3970,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
ctx->mode = result.uint_32 & 07777; ctx->mode = result.uint_32 & 07777;
break; break;
case Opt_uid: case Opt_uid:
kuid = make_kuid(current_user_ns(), result.uint_32); kuid = result.uid;
if (!uid_valid(kuid))
goto bad_value;
/* /*
* The requested uid must be representable in the * 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) ...@@ -3984,9 +3982,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
ctx->uid = kuid; ctx->uid = kuid;
break; break;
case Opt_gid: case Opt_gid:
kgid = make_kgid(current_user_ns(), result.uint_32); kgid = result.gid;
if (!gid_valid(kgid))
goto bad_value;
/* /*
* The requested gid must be representable in the * The requested gid must be representable in the
......
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