.nfsXXXXXX file location.
Hi all,
As per my knowledge, in nfs mounted file system, when a file is removed
in, .nfsXXXXXX file is generated in same dir if some one has that file
still open.
Is there any way, and how valid that would be, if the .nfsXXXXX can be
generated in some specific dir instead of same dir? Please let me know
your comments about this.
Recently I encountered a bug, where a file was open, and a try was made
to remove dir containing it. It failed, and because of that lots of
others error occurred. While searching on Google, I found many similar
bugs.
This can be solved if there is a way where we can specify a dir where
all such .nfsXXXXX files will be moved instead of in same dir. This
should make semantics of rmdir more close to traditional unix when a
file in that dir is open.
Thanks and
Regards,
Tushar Adeshara
Re: .nfsXXXXXX file location.
Tushar Adeshara wrote:
[color=blue]
> As per my knowledge, in nfs mounted file system, when a file is removed
> in, .nfsXXXXXX file is generated in same dir if some one has that file
> still open.[/color]
[color=blue]
> Is there any way, and how valid that would be, if the .nfsXXXXX can be
> generated in some specific dir instead of same dir? Please let me know
> your comments about this.[/color]
I think the .nfs* files are created (renamed) by the client, which
wouldn't know which directories are on the same file system.
[color=blue]
> Recently I encountered a bug, where a file was open, and a try was made
> to remove dir containing it. It failed, and because of that lots of
> others error occurred. While searching on Google, I found many similar
> bugs.[/color]
Well, the program could move it before removing the directory.
-- glen
Re: .nfsXXXXXX file location.
glen herrmannsfeldt wrote:[color=blue]
> Tushar Adeshara wrote:
>[color=green]
> > As per my knowledge, in nfs mounted file system, when a file is removed
> > in, .nfsXXXXXX file is generated in same Dir if some one has that file
> > still open.[/color]
>[color=green]
> > Is there any way, and how valid that would be, if the .nfsXXXXX can be
> > generated in some specific Dir instead of same Dir? Please let me know
> > your comments about this.[/color]
>
> I think the .nfs* files are created (renamed) by the client, which
> wouldn't know which directories are on the same file system.[/color]
Correct. How about modifying client to let it know where such a dir is
? Can there be any design problems with this approach ?
[color=blue]
>[color=green]
> > Recently I encountered a bug, where a file was open, and a try was made
> > to remove Dir containing it. It failed, and because of that lots of
> > others error occurred. While searching on Google, I found many similar
> > bugs.[/color]
>
> Well, the program could move it before removing the directory.[/color]
I have fixed the bug for now by ensuring that all files gets closed.
However, there can be lots of programs that will need modifications, to
be used correctly with nfs. My idea is to change nfs client itself
instead of chaning all programs.
Thanks and
Regards,
Tushar Adeshara
[color=blue]
>
> -- glen[/color]
Re: .nfsXXXXXX file location.
Tushar Adeshara wrote:
(snip)
[color=blue][color=green]
>>I think the .nfs* files are created (renamed) by the client, which
>>wouldn't know which directories are on the same file system.[/color][/color]
[color=blue]
> Correct. How about modifying client to let it know where such a dir is
> ? Can there be any design problems with this approach ?[/color]
It would probably have to be a new version of the protocol.
(snip)
[color=blue]
> I have fixed the bug for now by ensuring that all files gets closed.
> However, there can be lots of programs that will need modifications, to
> be used correctly with nfs. My idea is to change nfs client itself
> instead of chaning all programs.[/color]
If you
rm -rf
the directory, it will remove any files in it along the way.
The usual solution for .nfs file is a cron job that removes files
older than some number of days.
-- glen