Bug 22006

Summary: quotacheck halt
Product: Base System Reporter: wkwu <wkwu>
Component: i386Assignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1.1-STABLE   
Hardware: Any   
OS: Any   

Description wkwu 2000-10-15 16:40:01 UTC
/etc/fstab:
/dev/da0s1e     /raid1  ufs     rw,async,userquota,nosuid       2       2
/dev/da0s1f     /raid2  ufs     rw,async,userquota,nosuid       2       2

We enable quota on da0s1e da0s1f. when booting: quotacheck halt. 
so I ctrl+c, the quotacheck skips /raid2.

after booting, I quotacheck /dev/da0s1f, it halt again.
And I see that the quotacheck process's load is high. (CPU 99%)

I 'truss quotacheck /dev/da0s1f' :
[deleted]...
read(0x6,0x80ad000,0xe000)			 = 57344 (0xe000)
lseek(6,0xce60e8000,0)				 = -435257344 (0xe60e8000)
read(0x6,0x80ad000,0xe000)			 = 57344 (0xe000)
lseek(6,0xce60f6000,0)				 = -435200000 (0xe60f6000)
read(0x6,0x80ad000,0xa000)			 = 40960 (0xa000)
open("/raid2/quota.user",2,0666)		 = 7 (0x7)
open("/raid2/quota.user",0,0666)		 = 8 (0x8)
quotactl(0x807058c,0x60000,0x0,0x0)		 = 0 (0x0)
fstat(8,0xbfbff4d0)				 = 0 (0x0)
read(0x8,0x8096000,0x2000)			 = 8192 (0x2000)
fstat(7,0xbfbff480)				 = 0 (0x0)
lseek(7,0x0,0)					 = 0 (0x0)
quotactl(0x807058c,0x50000,0x0,0xbfbff620)	 ERR#22 'Invalid argument'
read(0x8,0x8096000,0x2000)			 = 8192 (0x2000)
read(0x8,0x8096000,0x2000)			 = 5568 (0x15c0)
read(0x8,0x8096000,0x2000)			 = 0 (0x0)
write(7,0x8098000,32)				 = 32 (0x20)
lseek(7,0x6c860,0)				 = 444512 (0x6c860)
quotactl(0x807058c,0x50000,0x3643,0xbfbff620)	 ERR#22 'Invalid argument'
SIGNAL 19
SIGNAL 2
SIGNAL 2
process exit, rval = 2

Fix: 

no idea.
Comment 1 Andre Albsmeier 2000-10-16 09:35:39 UTC
> 
> ...
> >Description:
> 
> /etc/fstab:
> /dev/da0s1e     /raid1  ufs     rw,async,userquota,nosuid       2       2
> /dev/da0s1f     /raid2  ufs     rw,async,userquota,nosuid       2       2
> 
> We enable quota on da0s1e da0s1f. when booting: quotacheck halt. 
> so I ctrl+c, the quotacheck skips /raid2.

What is the highest uid you have on /raid1 and /raid2 ?

You might want to look into PR #2325...

If this applies to your problem, I might have a patch for you.

	-Andre
Comment 2 wkwu 2000-10-17 08:16:56 UTC
On Mon, Oct 16, 2000 at 10:35:39AM +0200, Andre Albsmeier wrote:
> What is the highest uid you have on /raid1 and /raid2 ?
> You might want to look into PR #2325...
> If this applies to your problem, I might have a patch for you.

I have found that there are some files uid = -2.
It cause quotacheck halt...

By the way, shall we take it as a bug?
Comment 3 Andre Albsmeier 2000-10-17 13:28:13 UTC
On Tue, 17-Oct-2000 at 15:16:56 +0800, Wei-Kai-Wu wrote:
> On Mon, Oct 16, 2000 at 10:35:39AM +0200, Andre Albsmeier wrote:
> > What is the highest uid you have on /raid1 and /raid2 ?
> > You might want to look into PR #2325...
> > If this applies to your problem, I might have a patch for you.
> 
> I have found that there are some files uid = -2.
> It cause quotacheck halt...

It doesn't halt. It just scans the quotacheck file from 0 to 2^32-1
and this takes a while. Do you use PC-NFS? That is how I got these
uid -2 files into my filesystems.

If you are interested, this my (real ugly) patch to solve this:
It maps all uids > 65535 to user nobody. I use it for many years
now and it works great... Don't know about security concerns.

--- sbin/quotacheck/quotacheck.c.ORI	Mon Jul 31 09:20:54 2000
+++ sbin/quotacheck/quotacheck.c	Mon Jul 31 09:21:15 2000
@@ -506,6 +506,8 @@
 	struct fileusage *fup, **fhp;
 	int len;
 
+	if( id > 65535 )
+		id = 65534;
 	if ((fup = lookup(id, type)) != NULL)
 		return (fup);
 	if (name)
--- sys/ufs/ufs/ufs_quota.c.ORI	Mon Jul 31 09:36:03 2000
+++ sys/ufs/ufs/ufs_quota.c	Mon Jul 31 09:36:44 2000
@@ -750,6 +750,8 @@
 	/*
 	 * Check the cache first.
 	 */
+	if( id > 65535 )
+		id = 65534;
 	dqh = DQHASH(dqvp, id);
 	for (dq = dqh->lh_first; dq; dq = dq->dq_hash.le_next) {
 		if (dq->dq_id != id ||


> 
> By the way, shall we take it as a bug?

It is a bug. It is covered by my PR.

	-Andre
Comment 4 wkwu 2000-10-18 02:58:58 UTC
On Tue, Oct 17, 2000 at 02:28:13PM +0200, Andre Albsmeier wrote:
> > By the way, shall we take it as a bug?
> It is a bug. It is covered by my PR.

I mean that should the FreeBSD-source patch quotacheck?
Not ourself.
Comment 5 Andre Albsmeier 2000-10-18 05:55:32 UTC
On Wed, 18-Oct-2000 at 09:58:58 +0800, Wei-Kai-Wu wrote:
> On Tue, Oct 17, 2000 at 02:28:13PM +0200, Andre Albsmeier wrote:
> > > By the way, shall we take it as a bug?
> > It is a bug. It is covered by my PR.
> 
> I mean that should the FreeBSD-source patch quotacheck?
> Not ourself.

?!?
Comment 6 mpp freebsd_committer freebsd_triage 2001-07-22 15:20:49 UTC
State Changed
From-To: open->closed

Duplicate of PR# 2325.