aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-01-24 00:06:22 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2010-01-26 22:22:25 -0500
commit217686e98321a4ff4c1a6cc535e511e37c5d2dbf (patch)
tree8b68ea06a602d92d52e6c5a9d3c976a8991cccc7
parent29333920a5a46edcc9b728e2cf0134d5a9b516ee (diff)
fix affs parse_options()
Error handling in that sucker got broken back in 2003. If function returns 0 on failure, it's not nice to add return -EINVAL into it. Adding return 1 on other failure exits is also not a good thing (and yes, original success exits with 1 and some of failure exits with 0 are still there; so's the original logics in callers). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/affs/super.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index be6a6e8ed7d6..d41e9673cd97 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -203,7 +203,7 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
203 switch (token) { 203 switch (token) {
204 case Opt_bs: 204 case Opt_bs:
205 if (match_int(&args[0], &n)) 205 if (match_int(&args[0], &n))
206 return -EINVAL; 206 return 0;
207 if (n != 512 && n != 1024 && n != 2048 207 if (n != 512 && n != 1024 && n != 2048
208 && n != 4096) { 208 && n != 4096) {
209 printk ("AFFS: Invalid blocksize (512, 1024, 2048, 4096 allowed)\n"); 209 printk ("AFFS: Invalid blocksize (512, 1024, 2048, 4096 allowed)\n");
@@ -213,7 +213,7 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
213 break; 213 break;
214 case Opt_mode: 214 case Opt_mode:
215 if (match_octal(&args[0], &option)) 215 if (match_octal(&args[0], &option))
216 return 1; 216 return 0;
217 *mode = option & 0777; 217 *mode = option & 0777;
218 *mount_opts |= SF_SETMODE; 218 *mount_opts |= SF_SETMODE;
219 break; 219 break;
@@ -231,21 +231,21 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
231 break; 231 break;
232 case Opt_reserved: 232 case Opt_reserved:
233 if (match_int(&args[0], reserved)) 233 if (match_int(&args[0], reserved))
234 return 1; 234 return 0;
235 break; 235 break;
236 case Opt_root: 236 case Opt_root:
237 if (match_int(&args[0], root)) 237 if (match_int(&args[0], root))
238 return 1; 238 return 0;
239 break; 239 break;
240 case Opt_setgid: 240 case Opt_setgid:
241 if (match_int(&args[0], &option)) 241 if (match_int(&args[0], &option))
242 return 1; 242 return 0;
243 *gid = option; 243 *gid = option;
244 *mount_opts |= SF_SETGID; 244 *mount_opts |= SF_SETGID;
245 break; 245 break;
246 case Opt_setuid: 246 case Opt_setuid:
247 if (match_int(&args[0], &option)) 247 if (match_int(&args[0], &option))
248 return -EINVAL; 248 return 0;
249 *uid = option; 249 *uid = option;
250 *mount_opts |= SF_SETUID; 250 *mount_opts |= SF_SETUID;
251 break; 251 break;