From nobody@FreeBSD.org  Tue Dec  1 10:31:59 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 34CA5106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Dec 2009 10:31:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 230F78FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Dec 2009 10:31:59 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1AVwbF020268
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 1 Dec 2009 10:31:58 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id nB1AVwBI020265;
	Tue, 1 Dec 2009 10:31:58 GMT
	(envelope-from nobody)
Message-Id: <200912011031.nB1AVwBI020265@www.freebsd.org>
Date: Tue, 1 Dec 2009 10:31:58 GMT
From: Piotr Matuszczyk <piotr.matuszczyk@expro.pl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Problem with userquota, groupquota parameters in /etc/fstab
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         141050
>Category:       kern
>Synopsis:       fstab(5): Problem with userquota, groupquota parameters in /etc/fstab
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    avg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 01 10:40:00 UTC 2009
>Closed-Date:    Sun May 23 07:32:17 UTC 2010
>Last-Modified:  Sun May 23 07:32:17 UTC 2010
>Originator:     Piotr Matuszczyk
>Release:        8.0-RELEASE
>Organization:
Expro Sp. z o. o.
>Environment:
FreeBSD megatron.expro.pl 8.0-RELEASE FreeBSD 8.0-RELEASE #1: Thu Nov 26 12:41:38 CET 2009     root@megatron.expro.lan:/usr/obj/usr/src/sys/MEGATRON  amd64
>Description:
I`m installed FreeBSD 8.0-RELEASE on my Dell PE860 machine. I got source of system from cvs -> cvsup4.freebsd.org.
After compiled world and kernel, and installed world, kernel I put to /etc/fstab this line:

/dev/da0s1a / ufs rw,groupquota,userquota,noatime 1 1

I reboot the system and after kernel started I got this error:

---cut here---
Trying to mount root from ufs:/dev/da0s1a
mount option <groupquota> is unknown
mount option <userquota> is unknown
ROOT MOUNT ERROR: mount option <userquota> is unknown
If you have invalid mount options, reboot, and first try the following from the loader prompt:

      set vfs.root.mountfrom.options=rw
---cut here--

Of course "set vfs.root.mountfrom.options=rw" lets the system correctly starts, but I want userquota, groupquota in options for mount the root partitions.
>How-To-Repeat:
1) Clean install FreeBSD 8.0-RELEASE from CD/DVD or from cvs.
2) Put 'userquota,groupquota' options to line of root partition in /etc/fstab file
3) Reboot the system
>Fix:


>Release-Note:
>Audit-Trail:

From: piotr.matuszczyk@expro.pl
To: bug-followup@FreeBSD.org, piotr.matuszczyk@expro.pl
Cc:  
Subject: Re: amd64/141050: Problem with userquota, groupquota parameters in
 /etc/fstab
Date: Tue, 1 Dec 2009 12:38:08 +0100

 I forgot to add that of course I have:
 
 'options         QUOTA'
 
 in my kernel.
 
 ---
 Piotr Matuszczyk <piotr.matuszczyk@expro.pl>
 IT Administrator
 
 Expro sp. z o.o.
 ul. Kolista 25
 40-486 Katowice
 -=-=-=-=-=-=-=-=-
Responsible-Changed-From-To: freebsd-amd64->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Dec 1 17:26:06 UTC 2009 
Responsible-Changed-Why:  
Reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141050 

From: Mateusz Guzik <mjguzik@gmail.com>
To: bug-followup@FreeBSD.org, piotr.matuszczyk@expro.pl
Cc:  
Subject: Re: conf/141050: fstab(5): Problem with userquota, groupquota 
	parameters in /etc/fstab
Date: Wed, 2 Dec 2009 22:33:32 +0100

 Quotas are managed by quotaon/quotaoff (8), so mount(8) ignores quota-related
 options. Given that I believe it's safe to just omit those while mounting /.
 (Quotas will be enabled later by quotaon just like for non-root filesystems.)
 
 This patch should fix your issue:
 http://student.agh.edu.pl/~mjguzik/vfs_mount.diff
 
 --
 Mateusz Guzik

From: piotr.matuszczyk@expro.pl
To: bug-followup@FreeBSD.org, piotr.matuszczyk@expro.pl
Cc:  
Subject: Re: conf/141050: fstab(5): Problem with userquota, groupquota
 parameters in /etc/fstab
Date: Wed, 9 Dec 2009 15:07:31 +0100

 I understand what You are talking about.
 
 But, Your patch causes mount to ignore during system boot options 'userquota' and 'groupquota'.
 I think, it's a bit senselessly to modify the system with your patch, I can do the same simply by putting in '/etc/fstab' options 'rw,noatime'. 
 
 Secondly in the man for 'fstab' these two options are clearly described how to use them in the context of the 'fstab' file and what they indicate. If these two options in Freebsd 8.0 were supposed to be withdrawn, I beleive that there would be any information about it. 
 
 So if there is no information about it, and the options are still in man in FreeBSD 8.0, putting this options in 'fstab' file should behave the same as in older versions of Freebsd system.
 
 For this reason I am daring to claim, that it is a bug in the FreeBSD 8.0.
 
 ---
 Piotr Matuszczyk <piotr.matuszczyk@expro.pl>
 IT Administrator
 -=-=-=-=-=-=-=-=-

From: Svyatoslav Lempert <svyatoslav.lempert@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: conf/141050: fstab(5): Problem with userquota, groupquota 
	parameters in /etc/fstab
Date: Thu, 1 Apr 2010 10:18:41 +1000

 --00163630faaf461f54048321cf79
 Content-Type: text/plain; charset=UTF-8
 
 Hello!
 
 This patch really fix problem with enable quotas on the root (/)
 mountpoint, we use this patch for our servers (i386 and amd64
 systems).
 Please check and if possible assign this.
 
 Thanks in advance for your attention,
 
 I have re-attached patch file from Piotr Matuszczyk
 <piotr.matuszczyk@expro.pl> to PR-report, if it possible, I think,
 category must be
 changed to:
 Category: kern
 Class: change-request
 
 -- 
 Svyatoslav
 
 --00163630faaf461f54048321cf79
 Content-Type: application/octet-stream; name="vfs_mount.diff"
 Content-Disposition: attachment; filename="vfs_mount.diff"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_g7gti2xx0
 
 LS0tIHN5cy9rZXJuL3Zmc19tb3VudC5jLm9yaWcJMjAwOS0xMS0xMiAxNjo1OTowNS4wMDAwMDAw
 MDAgKzAxMDAKKysrIHN5cy9rZXJuL3Zmc19tb3VudC5jCTIwMDktMTItMDIgMjE6NTc6MzcuMDAw
 MDAwMDAwICswMTAwCkBAIC0xNzY0LDcgKzE3NjQsNyBAQAogCQkJKnZhbCA9ICdcMCc7CiAJCQkr
 K3ZhbDsKIAkJfQotCQlpZiggc3RyY21wKG5hbWUsICJydyIpID09IDAgfHwKKwkJaWYgKHN0cmNt
 cChuYW1lLCAicnciKSA9PSAwIHx8CiAJCSAgICBzdHJjbXAobmFtZSwgIm5vcm8iKSA9PSAwKSB7
 CiAJCQkvKgogCQkJICogVGhlIGZpcnN0IHRpbWUgd2UgbW91bnQgdGhlIHJvb3QgZmlsZSBzeXN0
 ZW0sCkBAIC0xNzczLDYgKzE3NzMsMTAgQEAKIAkJCSAqLwogCQkJY29udGludWU7CiAJCX0KKwkJ
 aWYgKHN0cmNtcChuYW1lLCAidXNlcnF1b3RhIikgPT0gMCB8fAorCQkgICAgc3RyY21wKG5hbWUs
 ICJncm91cHF1b3RhIikgPT0gMCkgeworCQkJY29udGludWU7CisJCX0KIAkJbmFtZV9hcmcgPSBz
 dHJkdXAobmFtZSwgTV9NT1VOVCk7CiAJCXZhbF9hcmcgPSBOVUxMOwogCQlpZiAodmFsICE9IE5V
 TEwpIAo=
 --00163630faaf461f54048321cf79--

From: "Zemancsik Zsolt" <darwick@cyberground.hu>
To: <bug-followup@FreeBSD.org>,
	<piotr.matuszczyk@expro.pl>
Cc:  
Subject: Re: conf/141050: fstab(5): Problem with userquota, groupquota parameters in /etc/fstab
Date: Thu, 1 Apr 2010 16:40:55 +0200

 Hello,
 
 I had the same error in the same environtment. The patch that was sent by 
 Mateusz Guzik and Svyatoslav Lempert is the same. Anyway, Piotr Matuszczyk 
 has right, this patch only ignores "userquota" and "groupquota" settings in 
 /etc/fstab. I made a try with this patch and it works for me on 8.0-p2 but 
 this can't be the final solution for the problem.
 The situation is if you have "userquota" and/or "groupquota" options in your 
 /etc/fstab and you reboot your Freebsd, the error messages will appears but 
 you can continue the booting process (eg. typeing ufs:/dev/ad0s1a). After 
 the succesfully boot, your quotas will works fine on the root filesystem 
 too, you only need to have a kernel with "options QUOTA" and 
 quota_enable="YES" line in your /etc/rc.conf. This is enough for it, 
 whatever is in fstab's man page. I don't understand clearly why we need to 
 put "userquota" and/or "groupquota" options in /etc/fstab but the quota 
 system will works fine without that settings.
 
 However, the "userquota" and/or "groupquota" options works fine without any 
 patch or fix on non-root filesystems.
 
 Best regards: Zemancsik Zsolt
 Systems Engineer 
 
Responsible-Changed-From-To: freebsd-bugs->avg 
Responsible-Changed-By: avg 
Responsible-Changed-When: Thu Apr 29 09:37:58 UTC 2010 
Responsible-Changed-Why:  
I'd like to handle this issue. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141050 

From: Andriy Gapon <avg@freebsd.org>
To: bug-followup@freebsd.org, piotr.matuszczyk@expro.pl
Cc:  
Subject: Re: conf/141050: fstab(5): Problem with userquota, groupquota parameters
 in /etc/fstab
Date: Thu, 29 Apr 2010 12:50:57 +0300

 This is not a configuration problem but rather a loader/kernel problem.
 The issue was introduced in r193192.
 loader now builds vfs.root.mountfrom and vfs.root.mountfrom.options kenv
 variables based on fstab contents, vfs.root.mountfrom.options is then passed as
 mount options by kernel.
 But userquota, groupquota options are meant only for userland and are not
 expected by UFS/FFS kernel code.
 So, either loader should be made aware of these options and should not include
 them in vfs.root.mountfrom.options, or UFS/FFS kernel code should know anout
 these options and should simply ignore them.
 The latter approach is what patches in this PR implement.  I think that this
 approach is indeed simpler and, perhaps, nicer than putting too much knowledge
 into loader.
 
 Thank you for the patches, I will try to get them committed.
 
 -- 
 Andriy Gapon

From: Andriy Gapon <avg@freebsd.org>
To: bug-followup@freebsd.org, piotr.matuszczyk@expro.pl,
        freebsd-fs@freebsd.org
Cc:  
Subject: Re: kern/141050: fstab(5): Problem with userquota, groupquota parameters
 in /etc/fstab
Date: Thu, 29 Apr 2010 13:12:41 +0300

 http://www.freebsd.org/cgi/query-pr.cgi?pr=141050
 
 I'd like to fix the issue with the following patch.
 Could you please review and/or test it?
 Thanks!
 
 Index: sys/ufs/ffs/ffs_vfsops.c
 ===================================================================
 --- sys/ufs/ffs/ffs_vfsops.c	(revision 207366)
 +++ sys/ufs/ffs/ffs_vfsops.c	(working copy)
 @@ -124,10 +124,16 @@
  #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)
 
 -- 
 Andriy Gapon

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/141050: commit references a PR
Date: Wed, 19 May 2010 09:32:20 +0000 (UTC)

 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);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: avg 
State-Changed-When: Wed May 19 10:47:52 UTC 2010 
State-Changed-Why:  
A fix is committed to head. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141050 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/141050: commit references a PR
Date: Sun, 23 May 2010 07:22:00 +0000 (UTC)

 Author: avg
 Date: Sun May 23 07:21:50 2010
 New Revision: 208435
 URL: http://svn.freebsd.org/changeset/base/208435
 
 Log:
   MFC r208293: ffs_mount: accept and drop userland-only options that can
   be passed from loader(8)
   
   PR:		kern/141050
 
 Modified:
   stable/8/sys/ufs/ffs/ffs_vfsops.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/xen/xenpci/   (props changed)
   stable/8/sys/geom/sched/   (props changed)
 
 Modified: stable/8/sys/ufs/ffs/ffs_vfsops.c
 ==============================================================================
 --- stable/8/sys/ufs/ffs/ffs_vfsops.c	Sun May 23 07:04:21 2010	(r208434)
 +++ stable/8/sys/ufs/ffs/ffs_vfsops.c	Sun May 23 07:21:50 2010	(r208435)
 @@ -125,10 +125,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)
 @@ -158,6 +164,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);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: avg 
State-Changed-When: Sun May 23 07:30:18 UTC 2010 
State-Changed-Why:  
The problem should now be resolved in head and stable/8. 
It is not present in other branches. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141050 
>Unformatted:
