svn commit: r208293 - head/sys/ufs/ffs

Andriy Gapon avg at FreeBSD.org
Wed May 19 09:32:11 UTC 2010


Author: avg
Date: Wed May 19 09:32:11 2010
New Revision: 208293
URL: http://svn.freebsd.org/changeset/base/208293

Log:
  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

Modified:
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c	Wed May 19 09:30:41 2010	(r208292)
+++ head/sys/ufs/ffs/ffs_vfsops.c	Wed May 19 09:32:11 2010	(r208293)
@@ -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);


More information about the svn-src-head mailing list