Bug 13882

Summary: mount(8) mount -p is missing the quota options
Product: Base System Reporter: Jim.Pirzyk <Jim.Pirzyk>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Works As Intended    
Severity: Affects Only Me CC: imp
Priority: Normal    
Version: 3.3-RELEASE   
Hardware: Any   
OS: Any   

Description Jim.Pirzyk 1999-09-21 19:50:01 UTC
	Here is my fstab file:

# Device			Mountpoint	FStype	Options				Dump	Pass#
/dev/wd0s1b		none			swap		sw					0	0
/dev/wd0s1a		/			ufs		rw					1	1
/dev/wd0s1e		/tmp			mfs		rw,nosuid,nodev		2	2
/dev/wcd0c		/cdrom		cd9660	ro,noauto				0	0
/dev/vinum/garage	/export		ufs		rw,nosuid,nodev,userquota 2	2
proc				/proc		procfs	rw					0	0

	Note that /export is mounted with userquota.  When 'mount -p' is run,
	this is the output:

/dev/wd0s1a	/	ufs rw	1 1
mfs:31	/tmp	mfs rw,nosuid,nodev,async	2 2
/dev/vinum/garage	/export	ufs rw,nosuid,nodev	2 2
procfs	/proc	procfs rw	0 0

How-To-Repeat: 
	Mount a filesystem with quotas on, then do a 'mount -p'
Comment 1 sjr 1999-09-22 04:27:24 UTC
On 21 Sep, Jim.Pirzyk@disney.com wrote:

>>Fix:

This seems easy to fix (including the other missing options):

--- mount.c.orig	Tue Sep 21 23:17:00 1999
+++ mount.c	Tue Sep 21 23:21:36 1999
@@ -721,6 +721,10 @@
 	if (flags & MNT_NOCLUSTERW)	res = catopt(res, "noclusterw");
 	if (flags & MNT_NOSYMFOLLOW)	res = catopt(res, "nosymfollow");
 	if (flags & MNT_SUIDDIR)	res = catopt(res, "suiddir");
+	if (flags & MOPT_USERQUOTA)	res = catopt(res, "userquota");
+	if (flags & MOPT_GROUPQUOTA)	res = catopt(res, "groupquota");
+	if (flags & MOPT_NOCLUSTERR)	res = catopt(res, "noclusterr");
+	if (flags & MOPT_NOCLUSTERW)	res = catopt(res, "noclusterw");
 
 	return res;
 }
Comment 2 sjr 1999-09-24 02:29:15 UTC
Apparently, the fix wasn't as easy as I thought.... The attached
patch fixes two missing options, but still doesn't handle
the quota options.

--- mount.c.orig	Tue Sep 21 23:17:00 1999
+++ mount.c	Thu Sep 23 21:14:05 1999
@@ -721,6 +721,8 @@
 	if (flags & MNT_NOCLUSTERW)	res = catopt(res, "noclusterw");
 	if (flags & MNT_NOSYMFOLLOW)	res = catopt(res, "nosymfollow");
 	if (flags & MNT_SUIDDIR)	res = catopt(res, "suiddir");
+	if (flags & MNT_NOCLUSTERR)	res = catopt(res, "noclusterr");
+	if (flags & MNT_NOCLUSTERW)	res = catopt(res, "noclusterw");
 
 	return res;
 }
Comment 3 Jim Pirzyk freebsd_committer freebsd_triage 2001-07-20 01:36:42 UTC
Responsible Changed
From-To: freebsd-bugs->pirzyk

my PR
Comment 4 Tilman Keskinoz freebsd_committer freebsd_triage 2004-04-23 15:21:04 UTC
Responsible Changed
From-To: pirzyk->freebsd-bugs

jim pirzyk returned his commit bit one year ago
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:14 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 6 Warner Losh freebsd_committer freebsd_triage 2024-01-15 17:57:36 UTC
Unfortunately, userquota and groupquota are not mount options. They are read by quotacheck(8) only and not passed to the filesystem. Since mount -p just looks at the current system state, it cannot get the quota information. It would have to match them up against the fstab.
I've added a note to the mount man page.
These patches won't produce working information.