lkml.org 
[lkml]   [2007]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: ncpfs unlink() handling question
Date
Hi,

On 21 Dec 2007, at 11:01, Atro Tossavainen wrote:
> I've just noticed that ncpfs (or rather, NetWare) doesn't implement
> POSIX semantics w.r.t. unlink(). Specifically, any operation that
> expects, according to POSIX, that the contents of an open but
> unlink()ed
> file should remain available to the application that has it open, such
> as
>
> perl -pi -e 's/a/b/;' a_file
>
> on a ncpfs mounted volume causes the contents of the file to be lost,
> as unlink() on ncpfs disposes of the file properly right away and the
> new file that is written is a 's/a/b/;' of an empty file, hence
> another
> empty file.

Correct. You can use an extension (i.e. instead of in-place use
a .orig or whatever) to get around this.

> I don't know whether there is any (sensible) way to fix this, but I
> would like to initiate a discussion on what would be the correct way
> for ncpfs to deal with this.

Of course there is. Implement POSIX unlink semantics in the ncpfs
kernel module by using the same method as the NFS kernel module uses,
i.e. open files are renamed instead of unlinked, so effectively
simulating the above method of using an extension. Just look at the
NFS source code (linux-2.6/fs/nfs/dir.c), search for "silly" (the
feature is called "silly rename")...

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/



\
 
 \ /
  Last update: 2007-12-21 13:07    [W:0.032 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site