aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2010-05-19 09:32:11 +0000
committerAndriy Gapon <avg@FreeBSD.org>2010-05-19 09:32:11 +0000
commit0b9626482b2c4bc997d1fe07a0e435d71fde31c9 (patch)
tree93b9cabd3b4693d5fe2d7639f253d00616b81c4f /sys/ufs
parent62486687ed63a5e029d0830bb5cd92cdceeb6b18 (diff)
downloadsrc-0b9626482b2c4bc997d1fe07a0e435d71fde31c9.tar.gz
src-0b9626482b2c4bc997d1fe07a0e435d71fde31c9.zip
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
Notes
Notes: svn path=/head/; revision=208293
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 2963514508ee..c099732398fd 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -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);