Subject: bin/299: mount(1) barfs on quota options
To: None <gnats-admin>
From: Luke Mewburn <lm@karybdis.cs.rmit.OZ.AU>
List: netbsd-bugs
Date: 06/21/1994 03:20:07
>Number: 299
>Category: bin
>Synopsis: mount(1) can't handle quota options in /etc/fstab
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: gnats-admin (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: lm
>Arrival-Date: Tue Jun 21 03:20:04 1994
>Originator: Luke Mewburn
>Organization:
Technical Services Group, Department of Computer Science, RMIT
>Release:
>Environment:
System: NetBSD karybdis 0.9C NetBSD 0.9C (KARYBDIS) #1: Sat Jun 18 18:35:26 EST 1994 root@karybdis:/Src/src/sys/arch/i386/compile/KARYBDIS i386
>Description:
if you have an entry in /etc/fstab for a filesystem with a userquota
or groupquota option, mount complains with
`mount -o userquota: option not supported'
or something similar.
>How-To-Repeat:
put `userquota' as an option for an fs in the fstab. E.g.:
/dev/wd0g /home ufs rw,userquota 1 2
unmount the fs (umount /home)
mount /home
(barfola time)
If you don't have the userquota option in /etc/fstab, then quotaon -a &
quotacheck -a won't function correctly.
>Fix:
A bit of a hack. I just changed mount so that `userquota' and
`groupquota' (along with `rw') never get passed as a -o option to a
child. I use strncmp because userquota/groupquota may be followed by
an `=some/file', so this ensures that the compare works.
Apply this patch.
*** sbin/mount/mount.c.PLM Tue Jun 21 19:31:08 1994
--- sbin/mount/mount.c Tue Jun 21 19:39:40 1994
***************
*** 508,514 ****
*p = '\0';
argv[argc++] = p+1;
}
! } else if (strcmp(p, "rw") != 0) {
argv[argc++] = "-o";
argv[argc++] = p;
}
--- 508,516 ----
*p = '\0';
argv[argc++] = p+1;
}
! } else if ( (strcmp(p, "rw") != 0) &&
! (strncmp(p, "userquota", 9) != 0) &&
! (strncmp(p, "groupquota", 10) != 0) ) {
argv[argc++] = "-o";
argv[argc++] = p;
}
[Hmm... I wonder how quotas worked for 4.4-lite - since I had a look
at that code and it seems to exhibit the same problem. ;]
Luke.
>Audit-Trail:
>Unformatted:
------------------------------------------------------------------------------