From nobody@FreeBSD.org  Fri Feb 18 14:53:48 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2EDC216A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Feb 2005 14:53:48 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0D2E243D46
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Feb 2005 14:53:48 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j1IErlD9007623
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Feb 2005 14:53:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j1IErlxu007622;
	Fri, 18 Feb 2005 14:53:47 GMT
	(envelope-from nobody)
Message-Id: <200502181453.j1IErlxu007622@www.freebsd.org>
Date: Fri, 18 Feb 2005 14:53:47 GMT
From: David WU <dyw@wyk69.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Too many files in a single directory slowing and then crashing the system
X-Send-Pr-Version: www-2.3

>Number:         77680
>Category:       kern
>Synopsis:       Too many files in a single directory slowing and then crashing the system
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 18 15:00:19 GMT 2005
>Closed-Date:    Fri Jul 08 04:56:45 GMT 2005
>Last-Modified:  Fri Jul 08 04:56:45 GMT 2005
>Originator:     David WU
>Release:        FreeBSD 5.3-RELEASE #0
>Organization:
>Environment:
/usr/obj/usr/src/sys/GENERIC  i386
>Description:
I have a mail server running mainly sendmail with amavisd-new and clamav and spamassasin.   The size of the quarantine directory /var/virusmails can grow fairly quickly due to the large number of files created.   I suspect when the size get to be larger than 8M (from the output of ls -l /var) the system will start to slow down considerably and if nothing is done will crash eventually, and will not be able to reboot without manually intervention, as fsck will fail no matter how many times the problematic file system is checked.   I had to remove manually all the files under /var/virusmails and perhaps even the directory itself before fsck can be used to make the file system clean enough for a reboot.     
>How-To-Repeat:
I do not really want to repeat the problem as I have no idea how long it takes the system to crash from the time it slows down as it is a production machine handling email.   Sorry about that.      
>Fix:
Since the directory is under usage, the workaround is to use a script to rename the old directory and then created a new one using the same name. of course this has to be done before the system crashes.     
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: kris 
State-Changed-When: Sat Feb 19 02:48:45 GMT 2005 
State-Changed-Why:  
Feedback requested 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77680 

From: Kris Kennaway <kris@obsecurity.org>
To: David WU <dyw@wyk69.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/77680: Too many files in a single directory slowing and then crashing the system
Date: Fri, 18 Feb 2005 18:48:40 -0800

 --3siQDZowHQqNOShm
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Fri, Feb 18, 2005 at 02:53:47PM +0000, David WU wrote:
 
 > I have a mail server running mainly sendmail with amavisd-new and
 > clamav and spamassasin.  The size of the quarantine directory
 > /var/virusmails can grow fairly quickly due to the large number of
 > files created.  I suspect when the size get to be larger than 8M
 > (from the output of ls -l /var) the system will start to slow down
 > considerably and if nothing is done will crash eventually, and will
 > not be able to reboot without manually intervention, as fsck will
 > fail no matter how many times the problematic file system is
 > checked.  I had to remove manually all the files under
 > /var/virusmails and perhaps even the directory itself before fsck
 > can be used to make the file system clean enough for a reboot.
 
 Please obtain a debugging traceback as explained in the chapter on
 kernel debugging in the developers' handbook.
 
 Kris
 
 --3siQDZowHQqNOShm
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.0 (FreeBSD)
 
 iD8DBQFCFqkHWry0BWjoQKURArUNAKDxyK4qhkLkfTemHjcT4JWjxjnxAwCeKxSi
 e5BAwOW4TgfyG5581By8NuI=
 =sAA6
 -----END PGP SIGNATURE-----
 
 --3siQDZowHQqNOShm--

From: David WU <dyw@www.wyk69.org>
To: Kris Kennaway <kris@obsecurity.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/77680: Too many files in a single directory slowing and
 then crashing the system
Date: Sun, 20 Feb 2005 15:01:58 +0800 (HKT)

 On Fri, 18 Feb 2005, Kris Kennaway wrote:
 
 > Please obtain a debugging traceback as explained in the chapter on
 > kernel debugging in the developers' handbook.
 
 Dear Kris,
 
 Not really want to do this but I will do this.   However it is going to 
 take a while until the problem directory fills up.
 
 
 Best
 David
 
State-Changed-From-To: feedback->closed 
State-Changed-By: kris 
State-Changed-When: Fri Jul 8 04:56:24 GMT 2005 
State-Changed-Why:  
Submitter no longer able to reproduce 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77680 
>Unformatted:
