From owner-freebsd-questions Tue Aug 5 04:55:33 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA08826 for questions-outgoing; Tue, 5 Aug 1997 04:55:33 -0700 (PDT) Received: from david.siemens.de (david.siemens.de [139.23.36.11]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA08821 for ; Tue, 5 Aug 1997 04:55:27 -0700 (PDT) Received: from salomon.mchp.siemens.de (salomon.siemens.de [139.23.33.13]) by david.siemens.de (8.8.6/8.8.5) with ESMTP id NAA07772 for ; Tue, 5 Aug 1997 13:55:25 +0200 (MDT) Received: from curry.mchp.siemens.de (daemon@curry.mchp.siemens.de [146.180.31.23]) by salomon.mchp.siemens.de (8.8.6/8.8.5) with ESMTP id NAA29098 for ; Tue, 5 Aug 1997 13:55:25 +0200 (MDT) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.8.6/8.8.6) id NAA00493 for ; Tue, 5 Aug 1997 13:55:22 +0200 (MET DST) From: Andre Albsmeier Message-Id: <199708051155.NAA04066@curry.mchp.siemens.de> Subject: Re: quota consistency ? In-Reply-To: <199708041451.LAA24888@gaia.coppe.ufrj.br> from Joao Carlos Mendes Luis at "Aug 4, 97 11:51:24 am" To: jonny@mailhost.coppe.ufrj.br (Joao Carlos Mendes Luis) Date: Tue, 5 Aug 1997 13:55:13 +0200 (CEST) Cc: freebsd-questions@freebsd.org X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Hi, > > I've changed my server's disks this weekend using the dump|restore > approach, but since them I cannot anymore run quotacheck: > > gaia::root [616] quotacheck -v /usr > *** Checking user and group quotas for /dev/rsd0f (/usr) > unknown uid: 4294967294 > unknown gid: 4294967293 > jonny fixed: blocks 673912 -> 673896 > nobody fixed: inodes 0 -> 252 blocks 0 -> 2130 > > >From this point it locks, consuming lots of CPU and calling no > syscall (ktrace -p). > > "find /usr -xdev -user 4294967294 -print" finds nothing. > > What can I do ??? > > Jonny This is the same problem I have run on. Have a look at my PR kern/2325. The problem is, that the quota file can be seen as an array of quota entries indexed by the user id. The user id's you have run across might come from a PC-NFS client writing to the filesystem without somebody logged in (at least this is the case here). In this case, the PC-NFS client writes to the BSD filesystem as user -2 which is the large number you can see here. You can imagine, that quotacheck running from root (0) to this high user id, will run endlessly. As a solution, I have patched quotacheck.c and ufs_quota.c so, that all uids higher than 65535 get mapped to nobody. This is sure ugly, and all professional hackers here will cry now, but it works here about 2 months. *** ufs_quota.c.ORI Tue Aug 5 13:33:47 1997 --- ufs_quota.c Tue Jul 22 14:26:01 1997 *************** *** 720,725 **** --- 720,727 ---- struct uio auio; int error; + if( id > 65535 ) + id = 65534; dqvp = ump->um_quotas[type]; if (dqvp == NULLVP || (ump->um_qflags[type] & QTF_CLOSING)) { *dqp = NODQUOT; *** quotacheck.c.ORI Tue Aug 5 13:33:47 1997 --- quotacheck.c Tue Jul 22 14:59:49 1997 *************** *** 501,506 **** --- 501,508 ---- struct fileusage *fup, **fhp; int len; + if( id > 65535 ) + id = 65534; if ((fup = lookup(id, type)) != NULL) return (fup); if (name) Good luck -Andre