On Tue, Jul 15, 2008 at 03:52:32PM -0600, Calum Mackay wrote:
> Ben Rockwood wrote:
> > To be clear, its not cleaning up the files that concerns me, but
> > creating them at all.
> 
> The files need to be created, in order to emulate the expected behaviour
> where open files remain accessible after unlinking, with the file being
> removed only on "last close". An NFSv3 server cannot support this, since
> there is no open/close in v3, and it's hard in v4, so we handle this on
> the client with the .nfsXXXX rename mechanism.

NFSv4 ought to be able to do avoid this, except that though v4 is
stateful, this statefulness is optional.

> The root cause of these files left lying around might be that something
> deleted the file whilst it was open, but the app that had it open
> crashed before it could close it (or the client crashed).

I wouldn't say that opening a file and unlink()ing it while holding it
open is bad behavior.  Unix has supported that forever, and it's
probably common behavior for temporary files (but then, those end up in
/tmp).  But for this particular reason it should be avoided.

What might help here is to create the .nfs files at the root of the
filesystem -- then there'd be no need to find(1) and unlink them
periodically.

Nico
-- 

Reply via email to