Skip to content

Commit d02f0bb

Browse files
Eric Sandeenbrauner
authored andcommitted
fat: 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] Acked-by: OGAWA Hirofumi <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 634440b commit d02f0bb

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

fs/fat/inode.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,8 +1091,8 @@ static const struct constant_table fat_param_conv[] = {
10911091
/* Core options. See below for vfat and msdos extras */
10921092
const struct fs_parameter_spec fat_param_spec[] = {
10931093
fsparam_enum ("check", Opt_check, fat_param_check),
1094-
fsparam_u32 ("uid", Opt_uid),
1095-
fsparam_u32 ("gid", Opt_gid),
1094+
fsparam_uid ("uid", Opt_uid),
1095+
fsparam_gid ("gid", Opt_gid),
10961096
fsparam_u32oct ("umask", Opt_umask),
10971097
fsparam_u32oct ("dmask", Opt_dmask),
10981098
fsparam_u32oct ("fmask", Opt_fmask),
@@ -1161,8 +1161,6 @@ int fat_parse_param(struct fs_context *fc, struct fs_parameter *param,
11611161
struct fat_mount_options *opts = fc->fs_private;
11621162
struct fs_parse_result result;
11631163
int opt;
1164-
kuid_t uid;
1165-
kgid_t gid;
11661164

11671165
/* remount options have traditionally been ignored */
11681166
if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE)
@@ -1209,16 +1207,10 @@ int fat_parse_param(struct fs_context *fc, struct fs_parameter *param,
12091207
opts->sys_immutable = 1;
12101208
break;
12111209
case Opt_uid:
1212-
uid = make_kuid(current_user_ns(), result.uint_32);
1213-
if (!uid_valid(uid))
1214-
return -EINVAL;
1215-
opts->fs_uid = uid;
1210+
opts->fs_uid = result.uid;
12161211
break;
12171212
case Opt_gid:
1218-
gid = make_kgid(current_user_ns(), result.uint_32);
1219-
if (!gid_valid(gid))
1220-
return -EINVAL;
1221-
opts->fs_gid = gid;
1213+
opts->fs_gid = result.gid;
12221214
break;
12231215
case Opt_umask:
12241216
opts->fs_fmask = opts->fs_dmask = result.uint_32;

0 commit comments

Comments
 (0)