Skip to content

Commit

Permalink
Btrfs: fail mount on bad mount options
Browse files Browse the repository at this point in the history
We shouldn't silently ignore unrecognized options.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Sage Weil authored and Chris Mason committed Dec 17, 2009
1 parent 06b2331 commit a7a3f7c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
substring_t args[MAX_OPT_ARGS];
char *p, *num;
int intarg;
int ret = 0;

if (!options)
return 0;
Expand Down Expand Up @@ -262,12 +263,18 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
case Opt_discard:
btrfs_set_opt(info->mount_opt, DISCARD);
break;
case Opt_err:
printk(KERN_INFO "btrfs: unrecognized mount option "
"'%s'\n", p);
ret = -EINVAL;
goto out;
default:
break;
}
}
out:
kfree(options);
return 0;
return ret;
}

/*
Expand Down

0 comments on commit a7a3f7c

Please sign in to comment.