Commit 5b3d5aeaa333850756f41350fed2fc95912b2a4f
Committed by
Linus Torvalds
1 parent
58156c8fbf
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>
Showing 1 changed file with 11 additions and 11 deletions Side-by-side Diff
fs/fat/inode.c
... | ... | @@ -972,41 +972,41 @@ |
972 | 972 | break; |
973 | 973 | case Opt_uid: |
974 | 974 | if (match_int(&args[0], &option)) |
975 | - return 0; | |
975 | + return -EINVAL; | |
976 | 976 | opts->fs_uid = make_kuid(current_user_ns(), option); |
977 | 977 | if (!uid_valid(opts->fs_uid)) |
978 | - return 0; | |
978 | + return -EINVAL; | |
979 | 979 | break; |
980 | 980 | case Opt_gid: |
981 | 981 | if (match_int(&args[0], &option)) |
982 | - return 0; | |
982 | + return -EINVAL; | |
983 | 983 | opts->fs_gid = make_kgid(current_user_ns(), option); |
984 | 984 | if (!gid_valid(opts->fs_gid)) |
985 | - return 0; | |
985 | + return -EINVAL; | |
986 | 986 | break; |
987 | 987 | case Opt_umask: |
988 | 988 | if (match_octal(&args[0], &option)) |
989 | - return 0; | |
989 | + return -EINVAL; | |
990 | 990 | opts->fs_fmask = opts->fs_dmask = option; |
991 | 991 | break; |
992 | 992 | case Opt_dmask: |
993 | 993 | if (match_octal(&args[0], &option)) |
994 | - return 0; | |
994 | + return -EINVAL; | |
995 | 995 | opts->fs_dmask = option; |
996 | 996 | break; |
997 | 997 | case Opt_fmask: |
998 | 998 | if (match_octal(&args[0], &option)) |
999 | - return 0; | |
999 | + return -EINVAL; | |
1000 | 1000 | opts->fs_fmask = option; |
1001 | 1001 | break; |
1002 | 1002 | case Opt_allow_utime: |
1003 | 1003 | if (match_octal(&args[0], &option)) |
1004 | - return 0; | |
1004 | + return -EINVAL; | |
1005 | 1005 | opts->allow_utime = option & (S_IWGRP | S_IWOTH); |
1006 | 1006 | break; |
1007 | 1007 | case Opt_codepage: |
1008 | 1008 | if (match_int(&args[0], &option)) |
1009 | - return 0; | |
1009 | + return -EINVAL; | |
1010 | 1010 | opts->codepage = option; |
1011 | 1011 | break; |
1012 | 1012 | case Opt_flush: |
1013 | 1013 | |
... | ... | @@ -1014,9 +1014,9 @@ |
1014 | 1014 | break; |
1015 | 1015 | case Opt_time_offset: |
1016 | 1016 | if (match_int(&args[0], &option)) |
1017 | - return 0; | |
1017 | + return -EINVAL; | |
1018 | 1018 | if (option < -12 * 60 || option > 12 * 60) |
1019 | - return 0; | |
1019 | + return -EINVAL; | |
1020 | 1020 | opts->tz_set = 1; |
1021 | 1021 | opts->time_offset = option; |
1022 | 1022 | break; |