Subject: Re: FFS reliability problems
To: NetBSD Kernel Technical Discussion List <tech-kern@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 06/13/2002 03:19:23
[ On Wednesday, June 12, 2002 at 21:46:05 (-0400), kpneal@pobox.com wrote: ]
> Subject: Re:  FFS reliability problems
>
> Who wants to try to explain to users why sometimes they can rm a file
> and sometimes they can't? 

What's to explain?  If the file is not open then the file is unlinked
and its storage free for reuse, but if the file is open then the kernel
returns EBUSY (or some new code like EOPEN).  This is not a new or
radically different concept -- it's all been done before and anyone with
any length of experience should already be very familiar with the idea.

> Who wants to make upgrades of a running system impossible because
> programs currently running can't be removed? I suppose you could get
> around this by renaming things first, but that seems gross and a giant
> leap backwards. 

Why do you think running programs need to use the 'open file' semantics?
That was just a cheap hack to get around the EBUSY problems initially
introduced with direct executable paging.  People did "get around this
by renaming things first" for many years and without much hardship.
However there's no reason why the very same hack has to be perpetuated
indefinitely.  Something similar but far more elegant and specific only
to the images of running programs could transparently take its place
without breaking the feature I proposed.

> Warping the way the filesystem works in order to work around broken
> applications seems like the exact wrong thing to do. 

This isn't in any way a "warp" or anything anywhere near so drastic --
it's not even a remotely new idea!

Indeed with the "FAQ" nature of the problem of invisible "anonymous"
disk utilisation by such "removed but open" files, such an enhancement
could be quite beneficial from an operational and systems management
perspective too.

If I had a dime for every idiot who removed an active syslog or other
similar open log file in order to try to free some disk space and then
wondered why there still wasn't any more free space afterwards I'd
probably be able to afford an early retirement!

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>