Commit 217686e98321a4ff4c1a6cc535e511e37c5d2dbf

Authored by Al Viro
1 parent 29333920a5

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>

Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff

... ... @@ -203,7 +203,7 @@
203 203 switch (token) {
204 204 case Opt_bs:
205 205 if (match_int(&args[0], &n))
206   - return -EINVAL;
  206 + return 0;
207 207 if (n != 512 && n != 1024 && n != 2048
208 208 && n != 4096) {
209 209 printk ("AFFS: Invalid blocksize (512, 1024, 2048, 4096 allowed)\n");
... ... @@ -213,7 +213,7 @@
213 213 break;
214 214 case Opt_mode:
215 215 if (match_octal(&args[0], &option))
216   - return 1;
  216 + return 0;
217 217 *mode = option & 0777;
218 218 *mount_opts |= SF_SETMODE;
219 219 break;
220 220  
221 221  
222 222  
... ... @@ -231,21 +231,21 @@
231 231 break;
232 232 case Opt_reserved:
233 233 if (match_int(&args[0], reserved))
234   - return 1;
  234 + return 0;
235 235 break;
236 236 case Opt_root:
237 237 if (match_int(&args[0], root))
238   - return 1;
  238 + return 0;
239 239 break;
240 240 case Opt_setgid:
241 241 if (match_int(&args[0], &option))
242   - return 1;
  242 + return 0;
243 243 *gid = option;
244 244 *mount_opts |= SF_SETGID;
245 245 break;
246 246 case Opt_setuid:
247 247 if (match_int(&args[0], &option))
248   - return -EINVAL;
  248 + return 0;
249 249 *uid = option;
250 250 *mount_opts |= SF_SETUID;
251 251 break;