mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
Btrfs: fail mount on bad mount options
We shouldn't silently ignore unrecognized options. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
06b2331f83
commit
a7a3f7cadd
1 changed files with 8 additions and 1 deletions
|
@ -128,6 +128,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
|
||||||
substring_t args[MAX_OPT_ARGS];
|
substring_t args[MAX_OPT_ARGS];
|
||||||
char *p, *num;
|
char *p, *num;
|
||||||
int intarg;
|
int intarg;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
if (!options)
|
if (!options)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -262,12 +263,18 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
|
||||||
case Opt_discard:
|
case Opt_discard:
|
||||||
btrfs_set_opt(info->mount_opt, DISCARD);
|
btrfs_set_opt(info->mount_opt, DISCARD);
|
||||||
break;
|
break;
|
||||||
|
case Opt_err:
|
||||||
|
printk(KERN_INFO "btrfs: unrecognized mount option "
|
||||||
|
"'%s'\n", p);
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto out;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
kfree(options);
|
kfree(options);
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue