From wkwu@ccstock.csie.nctu.edu.tw  Sun Oct 15 08:39:50 2000
Return-Path: <wkwu@ccstock.csie.nctu.edu.tw>
Received: from ccstock.csie.nctu.edu.tw (ccstock.csie.nctu.edu.tw [140.113.209.9])
	by hub.freebsd.org (Postfix) with ESMTP id C108237B66E
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Oct 2000 08:35:49 -0700 (PDT)
Received: (from wkwu@localhost)
	by ccstock.csie.nctu.edu.tw (8.11.1/8.9.3) id e9FFXIt01001;
	Sun, 15 Oct 2000 23:33:18 +0800 (CST)
	(envelope-from wkwu)
Message-Id: <200010151533.e9FFXIt01001@ccstock.csie.nctu.edu.tw>
Date: Sun, 15 Oct 2000 23:33:18 +0800 (CST)
From: wkwu@csie.nctu.edu.tw
Sender: wkwu@ccstock.csie.nctu.edu.tw
Reply-To: wkwu@csie.nctu.edu.tw
To: FreeBSD-gnats-submit@freebsd.org
Subject: quotacheck halt
X-Send-Pr-Version: 3.2

>Number:         22006
>Category:       i386
>Synopsis:       quotacheck halt
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 15 08:40:01 PDT 2000
>Closed-Date:    Sun Jul 22 07:20:49 PDT 2001
>Last-Modified:  Sun Jul 22 07:21:32 PDT 2001
>Originator:     Wei-Kai Wu
>Release:        FreeBSD 4.1.1-STABLE i386
>Organization:
Kavalan
>Environment:

FreeBSD 4.1.1-STABLE #0: Sun Oct 15 21:42:05 CST 2000
CPU: Pentium III/Pentium III Xeon/Celeron (551.25-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x681  Stepping = 1
real memory  = 134201344 (131056K bytes)
avail memory = 127422464 (124436K bytes)
Preloaded elf kernel "kernel" at 0xc02d7000.
Preloaded userconfig_script "/boot/kernel.conf" at 0xc02d70a8.
fxp0: <Intel Pro 10/100B/100+ Ethernet> 
ahc0: <Adaptec 29160 Ultra160 SCSI adapter> 
aic7892: Wide Channel A, SCSI Id=7, 32/255 SCBs
IP packet filtering initialized, divert enabled, rule-based forwarding enabled, default to accept, unlimited logging
ad0: 19574MB <IBM-DPTA-372050> [39770/16/63] at ata0-master using UDMA33
Waiting 5 seconds for SCSI devices to settle
da0 at ahc0 bus 0 target 0 lun 0
da0: <Proware 5960RN > Fixed Direct Access SCSI-2 device 
da0: 80.000MB/s transfers (40.000MHz, offset 31, 16bit), Tagged Queueing Enabled
da0: 105712MB (216498176 512 byte sectors: 255H 63S/T 13476C)
da1 at ahc0 bus 0 target 0 lun 1
da1: <Proware 5960RN > Fixed Direct Access SCSI-2 device 
da1: 80.000MB/s transfers (40.000MHz, offset 31, 16bit), Tagged Queueing Enabled
da1: 105712MB (216498176 512 byte sectors: 255H 63S/T 13476C)

>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.

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

>How-To-Repeat:



>Fix:

no idea.

>Release-Note:
>Audit-Trail:

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: wkwu@csie.nctu.edu.tw
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/22006: quotacheck halt
Date: Mon, 16 Oct 2000 10:35:39 +0200

 > 
 > ...
 > >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
 

From: Wei-Kai-Wu <wkwu@csie.nctu.edu.tw>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/22006: quotacheck halt
Date: Tue, 17 Oct 2000 15:16:56 +0800

 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?
 

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: Wei-Kai-Wu <wkwu@csie.nctu.edu.tw>
Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>,
	FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/22006: quotacheck halt
Date: Tue, 17 Oct 2000 14:28:13 +0200

 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
 

From: Wei-Kai-Wu <wkwu@csie.nctu.edu.tw>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: i386/22006: quotacheck halt
Date: Wed, 18 Oct 2000 09:58:58 +0800

 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.
 

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: Wei-Kai-Wu <wkwu@csie.nctu.edu.tw>
Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>,
	FreeBSD-gnats-submit@freebsd.org
Subject: Re: i386/22006: quotacheck halt
Date: Wed, 18 Oct 2000 06:55:32 +0200

 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.
 
 ?!?
 
State-Changed-From-To: open->closed 
State-Changed-By: mpp 
State-Changed-When: Sun Jul 22 07:20:49 PDT 2001 
State-Changed-Why:  
Duplicate of PR# 2325. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=22006 
>Unformatted:
