From owner-freebsd-hackers Thu Feb 18 22:44:54 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by hub.freebsd.org (Postfix) with ESMTP id 957E711637 for ; Thu, 18 Feb 1999 22:44:50 -0800 (PST) (envelope-from andre.albsmeier@mchp.siemens.de) X-Envelope-Sender-Is: andre.albsmeier@mchp.siemens.de (at relayer david.siemens.de) Received: from salomon.siemens.de (salomon.siemens.de [139.23.33.13]) by david.siemens.de (8.9.3/8.9.3) with ESMTP id HAA28514 for ; Fri, 19 Feb 1999 07:44:48 +0100 (MET) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [146.180.31.23]) by salomon.siemens.de (8.9.3/8.9.3) with ESMTP id HAA16274 for ; Fri, 19 Feb 1999 07:44:48 +0100 (MET) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.8.8/8.8.8) id HAA13092 for ; Fri, 19 Feb 1999 07:44:48 +0100 (CET) Date: Fri, 19 Feb 1999 07:44:45 +0100 From: Andre Albsmeier To: John Polstra Cc: Andre Albsmeier , hackers@FreeBSD.ORG Subject: Re: UIDs greater than 65535? Message-ID: <19990219074445.C4890@internal> References: <19990218093637.A1696@internal> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: ; from John Polstra on Thu, Feb 18, 1999 at 09:15:51PM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 *) 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