summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2010-05-19 09:32:11 +0000
committeravg <avg@FreeBSD.org>2010-05-19 09:32:11 +0000
commit4e8fc6f387a7fbb035e86b8b7188d1c214965e15 (patch)
tree93b9cabd3b4693d5fe2d7639f253d00616b81c4f /sys/ufs
parente644199c18f8f3fae7e0509e64e6d36ed7d8b7ea (diff)
downloadFreeBSD-src-4e8fc6f387a7fbb035e86b8b7188d1c214965e15.zip
FreeBSD-src-4e8fc6f387a7fbb035e86b8b7188d1c214965e15.tar.gz
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
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 2963514..c099732 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);
OpenPOWER on IntegriCloud