ffs_mount: accept and drop userland-only options that can be passed from

loader(8)

In r193192 loader(8) has grown an ability to pass root mount options
from fstab via vfs.root.mountfrom.options.  Unfortunately, some options
that can be present in fstab are for userland only and lead to root
mounting failure when seen by kernel.
Rather than teaching loader about FFS-specific options that should be
filtered out, ffs_mount recognizes those options as valid, but ignores
and deletes[1] them.

[1] is suggested by jh.

PR:		kern/141050
Reported by:	many
Reviewed by:	jh, bde
MFC after:	4 days
This commit is contained in:
Andriy Gapon 2010-05-19 09:32:11 +00:00
parent 62486687ed
commit 0b9626482b

View File

@ -124,10 +124,16 @@ static struct buf_ops ffs_ops = {
#endif
};
/*
* Note that userquota and groupquota options are not currently used
* by UFS/FFS code and generally mount(8) does not pass those options
* from userland, but they can be passed by loader(8) via
* vfs.root.mountfrom.options.
*/
static const char *ffs_opts[] = { "acls", "async", "noatime", "noclusterr",
"noclusterw", "noexec", "export", "force", "from", "multilabel",
"nfsv4acls", "snapshot", "nosuid", "suiddir", "nosymfollow", "sync",
"union", NULL };
"noclusterw", "noexec", "export", "force", "from", "groupquota",
"multilabel", "nfsv4acls", "snapshot", "nosuid", "suiddir", "nosymfollow",
"sync", "union", "userquota", NULL };
static int
ffs_mount(struct mount *mp)
@ -157,6 +163,9 @@ ffs_mount(struct mount *mp)
UMA_ALIGN_PTR, 0);
}
vfs_deleteopt(mp->mnt_optnew, "groupquota");
vfs_deleteopt(mp->mnt_optnew, "userquota");
fspec = vfs_getopts(mp->mnt_optnew, "from", &error);
if (error)
return (error);