mirror of
https://github.com/torvalds/linux
synced 2024-10-07 03:42:55 +00:00
vfs: don't parse forbidden flags
Makes little sense to keep this blacklist synced with what mount(8) parses and what it doesn't. E.g. it has various forms of "*atime" options, but not "atime"... Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
80340fe360
commit
9193ae87a8
|
@ -57,40 +57,12 @@ static const struct constant_table common_clear_sb_flag[] = {
|
||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *const forbidden_sb_flag[] = {
|
|
||||||
"bind",
|
|
||||||
"dev",
|
|
||||||
"exec",
|
|
||||||
"move",
|
|
||||||
"noatime",
|
|
||||||
"nodev",
|
|
||||||
"nodiratime",
|
|
||||||
"noexec",
|
|
||||||
"norelatime",
|
|
||||||
"nostrictatime",
|
|
||||||
"nosuid",
|
|
||||||
"private",
|
|
||||||
"rec",
|
|
||||||
"relatime",
|
|
||||||
"remount",
|
|
||||||
"shared",
|
|
||||||
"slave",
|
|
||||||
"strictatime",
|
|
||||||
"suid",
|
|
||||||
"unbindable",
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for a common mount option that manipulates s_flags.
|
* Check for a common mount option that manipulates s_flags.
|
||||||
*/
|
*/
|
||||||
static int vfs_parse_sb_flag(struct fs_context *fc, const char *key)
|
static int vfs_parse_sb_flag(struct fs_context *fc, const char *key)
|
||||||
{
|
{
|
||||||
unsigned int token;
|
unsigned int token;
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(forbidden_sb_flag); i++)
|
|
||||||
if (strcmp(key, forbidden_sb_flag[i]) == 0)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
token = lookup_constant(common_set_sb_flag, key, 0);
|
token = lookup_constant(common_set_sb_flag, key, 0);
|
||||||
if (token) {
|
if (token) {
|
||||||
|
|
Loading…
Reference in a new issue