aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/affs/super.c')
-rw-r--r--fs/affs/super.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 2f57053bf26c..b84dc7352502 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -193,7 +193,7 @@ static const match_table_t tokens = {
193}; 193};
194 194
195static int 195static int
196parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s32 *root, 196parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved, s32 *root,
197 int *blocksize, char **prefix, char *volume, unsigned long *mount_opts) 197 int *blocksize, char **prefix, char *volume, unsigned long *mount_opts)
198{ 198{
199 char *p; 199 char *p;
@@ -258,13 +258,17 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
258 case Opt_setgid: 258 case Opt_setgid:
259 if (match_int(&args[0], &option)) 259 if (match_int(&args[0], &option))
260 return 0; 260 return 0;
261 *gid = option; 261 *gid = make_kgid(current_user_ns(), option);
262 if (!gid_valid(*gid))
263 return 0;
262 *mount_opts |= SF_SETGID; 264 *mount_opts |= SF_SETGID;
263 break; 265 break;
264 case Opt_setuid: 266 case Opt_setuid:
265 if (match_int(&args[0], &option)) 267 if (match_int(&args[0], &option))
266 return 0; 268 return 0;
267 *uid = option; 269 *uid = make_kuid(current_user_ns(), option);
270 if (!uid_valid(*uid))
271 return 0;
268 *mount_opts |= SF_SETUID; 272 *mount_opts |= SF_SETUID;
269 break; 273 break;
270 case Opt_verbose: 274 case Opt_verbose:
@@ -306,8 +310,8 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
306 int num_bm; 310 int num_bm;
307 int i, j; 311 int i, j;
308 s32 key; 312 s32 key;
309 uid_t uid; 313 kuid_t uid;
310 gid_t gid; 314 kgid_t gid;
311 int reserved; 315 int reserved;
312 unsigned long mount_flags; 316 unsigned long mount_flags;
313 int tmp_flags; /* fix remount prototype... */ 317 int tmp_flags; /* fix remount prototype... */
@@ -532,8 +536,8 @@ affs_remount(struct super_block *sb, int *flags, char *data)
532{ 536{
533 struct affs_sb_info *sbi = AFFS_SB(sb); 537 struct affs_sb_info *sbi = AFFS_SB(sb);
534 int blocksize; 538 int blocksize;
535 uid_t uid; 539 kuid_t uid;
536 gid_t gid; 540 kgid_t gid;
537 int mode; 541 int mode;
538 int reserved; 542 int reserved;
539 int root_block; 543 int root_block;
@@ -556,7 +560,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
556 return -EINVAL; 560 return -EINVAL;
557 } 561 }
558 562
559 flush_delayed_work_sync(&sbi->sb_work); 563 flush_delayed_work(&sbi->sb_work);
560 replace_mount_options(sb, new_opts); 564 replace_mount_options(sb, new_opts);
561 565
562 sbi->s_flags = mount_flags; 566 sbi->s_flags = mount_flags;