Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Aug 1997 13:55:13 +0200 (CEST)
From:      Andre Albsmeier <Andre.Albsmeier@mchp.siemens.de>
To:        jonny@mailhost.coppe.ufrj.br (Joao Carlos Mendes Luis)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: quota consistency ?
Message-ID:  <199708051155.NAA04066@curry.mchp.siemens.de>
In-Reply-To: <199708041451.LAA24888@gaia.coppe.ufrj.br> from Joao Carlos Mendes Luis at "Aug 4, 97 11:51:24 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



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