*BSD News Article 76249


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.mel.connect.com.au!news.mira.net.au!vic.news.telstra.net!act.news.telstra.net!imci3!newsfeed.internetmci.com!in2.uu.net!news.alt.net!news1.alt.net!news.serv.net!not-for-mail
From: zeno@serv.net (Sean T. Lamont)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: How to determine fd's owner?
Date: 16 Aug 1996 02:38:43 -0700
Organization: ServNet Internet Services, Seattle, WA
Lines: 41
Message-ID: <4v1fj3$8pm@itchy.serv.net>
NNTP-Posting-Host: itchy.serv.net

I have a bit of a connundrum.

For system reasons, on an NFS-mounted partition, 
I'm doing the equivalent of the following:

open "file", read contents, close file1.
open "file1.n" for write, write contents of file1.n, close file1.n.
rename "file1.n" to "file1".


Now everything works spiffy except the fact that I'm leaking disk memory.
each time the operation is executed, the remote disk loses a half meg or
so, which eventually fills up the disk, rendering the operation useless.

I originally thought that this was  a problem of the nfs client renaming
an open file descriptor, so I was trying to figure out which process on
the server side was still "locking" it. (unix does not de-allocate disk
space until the last file descriptor referencing the file is closed.)

I kill off a couple of local processes. No help. I kill off a couple more.
Still no help. Ok, maybe it's the NFSD processes? NFS is no longer working
from the remote site, but still no luck. Inetd? syslogd? I killed off 
nearly EVERY process on the system, and the disk space was still not freed.
the ONLY way that I can seemingly return this disk space is by re-booting
the system. Is init or pagedaemon doing this? Why would it?


What the heck is going on here? Is there some way that I can view the 
active open file descriptors and who's locking them? I'm at a bit of a loss
here.






-- 
Sean T. Lamont, President / Chief NetNerd, Abstract Software, Inc. (ServNet)  
- Internet access * WWW hosting * TCP/IP * UNIX * NEXTSTEP * WWW Development -
email: lamont@abstractsoft.com              WWW:  http://www.serv.net
"...There's no moral, it's just a lot of stuff that happens". - H. Simpson