From cjohnson@neunacht.netgsi.com  Thu Jan  8 22:39:53 1998
Received: from neunacht.netgsi.com (neunacht.netgsi.com [192.55.203.37])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA20690
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 8 Jan 1998 22:39:52 -0800 (PST)
          (envelope-from cjohnson@neunacht.netgsi.com)
Received: (from cjohnson@localhost)
	by neunacht.netgsi.com (8.8.8/8.8.6) id BAA03491;
	Fri, 9 Jan 1998 01:40:29 -0500 (EST)
Message-Id: <199801090640.BAA03491@neunacht.netgsi.com>
Date: Fri, 9 Jan 1998 01:40:29 -0500 (EST)
From: "Christopher T. Johnson" <cjohnson@neunacht.netgsi.com>
Reply-To: cjohnson@neunacht.netgsi.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: unlink() leaves unrefed files on file sytem
X-Send-Pr-Version: 3.2

>Number:         5467
>Category:       kern
>Synopsis:       unlink() leaves unrefed files on file sytem
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan  8 22:40:01 PST 1998
>Closed-Date:    Thu May 7 00:04:32 PDT 1998
>Last-Modified:  Thu May  7 00:05:02 PDT 1998
>Originator:     Christopher T. Johnson
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
NetGSI, Inc
>Environment:
FreeBSD-CURRENT as of a CVSUP around Dec 28th.
	

>Description:
When a file has been mmap()ed, and then is unlinked, it seems that even
when the file is munmap()ed, the inode is not cleared.

This problem was noticed when /var, a 300Mb filesystem, suddenly started
running out of space.

We run a perl script that uses a C program to analyse files and then unlink
files that the program rejects (with databasing added).  The processing
sequence is:
	perl script discovers a file to analyis.
	perl script sends file name to C program over an unamed pipe.
	C program uses mmap() to access the file.
	C program analysises the file
	C program sends result to perl script
	perl script unlinks file if file is unwanted
LOOP:
	perl script finds next file
	perl script send file name to C program
	C program uses munmap() to release previous file
	C program uses mmap() to access the new file
	C program send result to perl script
	perl script unlinks file if file is unwanted
	GOTO LOOP

>How-To-Repeat:

	

>Fix:
	
	

>Release-Note:
>Audit-Trail:

From: "John S. Dyson" <toor@dyson.iquest.net>
To: cjohnson@neunacht.netgsi.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/5467: unlink() leaves unrefed files on file sytem
Date: Sun, 11 Jan 1998 04:45:37 -0500 (EST)

 Christopher T. Johnson said:
 > 
 > >Number:         5467
 > >Category:       kern
 > >Synopsis:       unlink() leaves unrefed files on file sytem
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       high
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Thu Jan  8 22:40:01 PST 1998
 > >Last-Modified:
 > >Originator:     Christopher T. Johnson
 > >Organization:
 > NetGSI, Inc
 > >Release:        FreeBSD 3.0-CURRENT i386
 > >Environment:
 > FreeBSD-CURRENT as of a CVSUP around Dec 28th.
 > 	
 This is a known problem in current as of the date that you have noted.  It is
 better now, but I suggest re-supping and trying again on 13 Jan 98.  (I have
 fixes in my local tree, and will be committing them tomorrow.)
 
 
 -- 
 John                  | Never try to teach a pig to sing,
 dyson@freebsd.org     | it just makes you look stupid,
 jdyson@nc.com         | and it irritates the pig.
State-Changed-From-To: open->feedback 
State-Changed-By: phk 
State-Changed-When: Thu Apr 30 22:51:18 PDT 1998 
State-Changed-Why:  
working now ? 
State-Changed-From-To: feedback->closed 
State-Changed-By: phk 
State-Changed-When: Thu May 7 00:04:32 PDT 1998 
State-Changed-Why:  
originator says "fixed".  Thanks! 
>Unformatted:
