Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Feb 1999 07:44:45 +0100
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        John Polstra <jdp@polstra.com>
Cc:        Andre Albsmeier <andre.albsmeier@mchp.siemens.de>, hackers@FreeBSD.ORG
Subject:   Re: UIDs greater than 65535?
Message-ID:  <19990219074445.C4890@internal>
In-Reply-To: <XFMail.990218211551.jdp@polstra.com>; from John Polstra on Thu, Feb 18, 1999 at 09:15:51PM -0800
References:  <19990218093637.A1696@internal> <XFMail.990218211551.jdp@polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 18-Feb-1999 at 21:15:51 -0800, John Polstra wrote:
> 
> Andre Albsmeier wrote:
> > On Wed, 17-Feb-1999 at 22:10:41 -0800, John Polstra wrote:
> >> Can anybody think of a reason why UIDs > 65535 wouldn't work under
> >> FreeBSD?  They seem to work, and I can't find any reason why they
> >> shouldn't.  Even the NFS protocol (though not necessarily all NFS
> >> servers) seems to be able to accomodate 4-byte UIDs.
> > 
> > I can only tell that quotas get big problems with ultra large uid's.
> > 
> > See PR# 2325. I have a local fix here... it is ugly as sin and it
> > doesn't fix the problem but the effects.
> 
> Thanks for telling me about this.  I took a brief look at it.  It
> looks like it won't be a problem for me, as long as the UID space is
> tightly packed.

Hmm, I don't think it is the _packing_ of the UID space. It's the high
UID's... If I understood it correctly, the quotas are handled as an
array of structs (one 32 Byte struct for each user). My quota
file has a size of 2097120. That means, 2097120/32 = 65535 entries
which is correct. If you got a user ID of 10.000.000 the quota
array should be already 320.000.000 bytes of size at least.

The whole quota system is IMHO very inefficient for large UID's (well,
large in the sense of being higher than 1.000.0000...). The reason, why
I noticed it was the follwing:

My users worked with PCNFS to write files to their public writable
directories. Because they are lazy, they don't log into the PCNFS machine
(net name <username> *) and so PCNFS works as user nobody (-2), But -2 is
3^32-1 and this turned out to be the last UID :-).

My local quick and dirty "fix" is (of course, I don't have UIDs
above 65535):

--- sbin/quotacheck/quotacheck.c.ORI	Wed Aug 12 20:52:36 1998
+++ sbin/quotacheck/quotacheck.c	Wed Aug 12 20:56:38 1998
@@ -501,6 +501,10 @@
 	struct fileusage *fup, **fhp;
 	int len;
 
+#ifdef ANDRE
+	if( id > 65535 )
+		id = 65534;
+#endif
 	if ((fup = lookup(id, type)) != NULL)
 		return (fup);
 	if (name)
--- sys/ufs/ufs/ufs_quota.c.ORI	Mon Apr 27 19:28:30 1998
+++ sys/ufs/ufs/ufs_quota.c	Thu Sep 18 08:48:59 1997
@@ -720,6 +720,10 @@
 	struct uio auio;
 	int error;
 
+#ifdef ANDRE
+	if( id > 65535 )
+		id = 65534;
+#endif
 	dqvp = ump->um_quotas[type];
 	if (dqvp == NULLVP || (ump->um_qflags[type] & QTF_CLOSING)) {
 		*dqp = NODQUOT;




BTW, thanks for the fix to the linux stuff under 3.x:

> jdp already fixed it :-)

...

> > ! #define ELF_RTLD_ADDR(vmspace) \  
> > !     (round_page((vm_offset_t)(vmspace)->vm_daddr + MAXDSIZ))


:-)

	-Andre


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990219074445.C4890>