diff options
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index fd8e47cd898b..4e5a6ac54ebd 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -796,10 +796,12 @@ static int fat_show_options(struct seq_file *m, struct dentry *root) | |||
796 | struct fat_mount_options *opts = &sbi->options; | 796 | struct fat_mount_options *opts = &sbi->options; |
797 | int isvfat = opts->isvfat; | 797 | int isvfat = opts->isvfat; |
798 | 798 | ||
799 | if (opts->fs_uid != 0) | 799 | if (!uid_eq(opts->fs_uid, GLOBAL_ROOT_UID)) |
800 | seq_printf(m, ",uid=%u", opts->fs_uid); | 800 | seq_printf(m, ",uid=%u", |
801 | if (opts->fs_gid != 0) | 801 | from_kuid_munged(&init_user_ns, opts->fs_uid)); |
802 | seq_printf(m, ",gid=%u", opts->fs_gid); | 802 | if (!gid_eq(opts->fs_gid, GLOBAL_ROOT_GID)) |
803 | seq_printf(m, ",gid=%u", | ||
804 | from_kgid_munged(&init_user_ns, opts->fs_gid)); | ||
803 | seq_printf(m, ",fmask=%04o", opts->fs_fmask); | 805 | seq_printf(m, ",fmask=%04o", opts->fs_fmask); |
804 | seq_printf(m, ",dmask=%04o", opts->fs_dmask); | 806 | seq_printf(m, ",dmask=%04o", opts->fs_dmask); |
805 | if (opts->allow_utime) | 807 | if (opts->allow_utime) |
@@ -1042,12 +1044,16 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, | |||
1042 | case Opt_uid: | 1044 | case Opt_uid: |
1043 | if (match_int(&args[0], &option)) | 1045 | if (match_int(&args[0], &option)) |
1044 | return 0; | 1046 | return 0; |
1045 | opts->fs_uid = option; | 1047 | opts->fs_uid = make_kuid(current_user_ns(), option); |
1048 | if (!uid_valid(opts->fs_uid)) | ||
1049 | return 0; | ||
1046 | break; | 1050 | break; |
1047 | case Opt_gid: | 1051 | case Opt_gid: |
1048 | if (match_int(&args[0], &option)) | 1052 | if (match_int(&args[0], &option)) |
1049 | return 0; | 1053 | return 0; |
1050 | opts->fs_gid = option; | 1054 | opts->fs_gid = make_kgid(current_user_ns(), option); |
1055 | if (!gid_valid(opts->fs_gid)) | ||
1056 | return 0; | ||
1051 | break; | 1057 | break; |
1052 | case Opt_umask: | 1058 | case Opt_umask: |
1053 | if (match_octal(&args[0], &option)) | 1059 | if (match_octal(&args[0], &option)) |