From owner-freebsd-questions Fri Mar 24 11:13:31 2000 Delivered-To: freebsd-questions@freebsd.org Received: from horst.bfd.com (horst.bfd.com [12.9.219.10]) by hub.freebsd.org (Postfix) with ESMTP id 1AE3137B545 for ; Fri, 24 Mar 2000 11:13:26 -0800 (PST) (envelope-from ejs@bfd.com) Received: from HARLIE.bfd.com (bastion.bfd.com [12.9.219.14]) by horst.bfd.com (8.10.0/8.10.0) with ESMTP id e2OJDLv79868; Fri, 24 Mar 2000 11:13:21 -0800 (PST) Date: Fri, 24 Mar 2000 11:13:21 -0800 (PST) From: "Eric J. Schwertfeger" To: Troy Settle Cc: freebsd-questions@FreeBSD.ORG Subject: RE: filesystem full? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 24 Mar 2000, Troy Settle wrote: > > > Hmm... bad taste to reply to one's own posts... but, I need to make a > correction: > > > ** If a process dies out, the kernel should release all resources used by that > ** process. The only processes using the /var filesystem, are the > ** default system > ** processes. I can't make any claims otherwise. > > After re-reading other replies, this should read: > > If a process has a file open, the kernel should not allow a user or another > process to delete said file. According to unix filesystem semantics, deleting a file that is in use is perfectly legitimate, and changing this would in fact break software. A file is a set of blocks on the disk pointed to by an inode. A directory entry is a pointer to the inode. When you open a file, the inode is resolved and the filename itself is no longer used. The distinction becomes critical in cases like this, or when dealing with hard links, which are multiple directory entries for the same inode. Now, when you delete or rename a file, you're not affecting the inode, but the directory entry. However, the inode usage count gets decremented, and when it drops to zero, the inode and associated blocks are considered free. Now, in the case where a program has a file open, the inode usage doesn't drop to 0 until the program closes the filehandle. Am I being clear? I've explained this to people that I work with, but email is different (no feedback, no gestures, etc). It's a simple concept, but one that isn't expected, so most people trip over it their first time. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message