Skip to content

Commit 5b3d5ae

Browse files
jankaratorvalds
authored andcommitted
fat: ix mount option parsing
parse_options() is supposed to return value < 0 on error however we returned 0 (success) in a lot of cases. This actually was not a problem in practice because match_token() used by parse_options() is clever and catches most of the problems for us. Signed-off-by: Jan Kara <jack@suse.cz> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 58156c8 commit 5b3d5ae

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

‎fs/fat/inode.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -972,51 +972,51 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat,
972972
break;
973973
case Opt_uid:
974974
if (match_int(&args[0], &option))
975-
return 0;
975+
return -EINVAL;
976976
opts->fs_uid = make_kuid(current_user_ns(), option);
977977
if (!uid_valid(opts->fs_uid))
978-
return 0;
978+
return -EINVAL;
979979
break;
980980
case Opt_gid:
981981
if (match_int(&args[0], &option))
982-
return 0;
982+
return -EINVAL;
983983
opts->fs_gid = make_kgid(current_user_ns(), option);
984984
if (!gid_valid(opts->fs_gid))
985-
return 0;
985+
return -EINVAL;
986986
break;
987987
case Opt_umask:
988988
if (match_octal(&args[0], &option))
989-
return 0;
989+
return -EINVAL;
990990
opts->fs_fmask = opts->fs_dmask = option;
991991
break;
992992
case Opt_dmask:
993993
if (match_octal(&args[0], &option))
994-
return 0;
994+
return -EINVAL;
995995
opts->fs_dmask = option;
996996
break;
997997
case Opt_fmask:
998998
if (match_octal(&args[0], &option))
999-
return 0;
999+
return -EINVAL;
10001000
opts->fs_fmask = option;
10011001
break;
10021002
case Opt_allow_utime:
10031003
if (match_octal(&args[0], &option))
1004-
return 0;
1004+
return -EINVAL;
10051005
opts->allow_utime = option & (S_IWGRP | S_IWOTH);
10061006
break;
10071007
case Opt_codepage:
10081008
if (match_int(&args[0], &option))
1009-
return 0;
1009+
return -EINVAL;
10101010
opts->codepage = option;
10111011
break;
10121012
case Opt_flush:
10131013
opts->flush = 1;
10141014
break;
10151015
case Opt_time_offset:
10161016
if (match_int(&args[0], &option))
1017-
return 0;
1017+
return -EINVAL;
10181018
if (option < -12 * 60 || option > 12 * 60)
1019-
return 0;
1019+
return -EINVAL;
10201020
opts->tz_set = 1;
10211021
opts->time_offset = option;
10221022
break;

0 commit comments

Comments
 (0)