cs-systems-top

Making VXFS quota work over NFS on Solaris

We're using:

We've recently started using VXFS filesystems exported over NFS as user filestore. A key requirement to this was to have working quotas. Out of the box these don't work. We spoke to Veritas and they (correctly) said the issue was with Solaris. We then spoke to Sun who acknowledged the problem, but couldn't provide a fix.

We decided to look at this ourselves. With the availablility of OpenSolaris we figured it might not be that hard to fix. We were right.

Here in its entirety is our patch to rpc.rquotad.c which fixes the problem:

--- rpc.rquotad.c	2005/12/13 12:14:36	1.1
+++ rpc.rquotad.c	2005/12/13 12:14:56	1.2
@@ -56,6 +56,9 @@
 #define	QFNAME		"quotas"	/* name of quota file */
 #define	RPCSVC_CLOSEDOWN 120		/* 2 minutes */
 
+/* added by tdb */
+#define	MNTTYPE_VXFS	"vxfs"
+
 struct fsquot {
 	struct fsquot *fsq_next;
 	char *fsq_dir;
@@ -445,7 +448,9 @@
 	}
 
 	while (getmntent(mt, &m) == 0) {
-		if (strcmp(m.mnt_fstype, MNTTYPE_UFS) != 0)
+		/* modified by tdb to test for VXFS too */
+		if (strcmp(m.mnt_fstype, MNTTYPE_UFS) != 0 &&
+			strcmp(m.mnt_fstype, MNTTYPE_VXFS) != 0)
 			continue;
 		if (!hasquota(m.mnt_mntopts)) {
 			sprintf(qfilename, "%s/%s", m.mnt_mountp, QFNAME);

So it works fine if you change the test that's explicitly looking for UFS. To compile this you'll probably need the Sun C compiler (Sun Studio 10 is what we used), our Makefile which is loosely taken from the OpenSolaris version, and of course the original source.

We're more than happy to hear any feedback on whether this works for you, or if you spot a glaring mistake in what we've done.

kent-small

Problems with this page? Contact cs-syshelp