All of lore.kernel.org
 help / color / mirror / Atom feed
* Does nfsd.o handle overwriting of files properly?
@ 2004-08-13  7:04 Per Buer
  2004-08-13 16:06 ` Trond Myklebust
  0 siblings, 1 reply; 2+ messages in thread
From: Per Buer @ 2004-08-13  7:04 UTC (permalink / raw)
  To: nfs

Hi.

We have a daemon which does the following. Create a new file "foo" and renames 
this file to "bar". This happens on a nfs volume. The problem seems to be 
that we get "stale NFS handle" right after "bar" is overwritten.

I guess the directory is cached and so the dentry points to an non-existing 
inode (as the old "bar" is deleted when the ref-count hits zero). 

Server: RHEL AS 2.1 (2.4.9 with lots and lots of pathes)
Client: RHEL ES 3.0 (2.4.21with lots and lots of pathes)

I fix could be to keep an link to the old "bar" hanging around for 30s or so - 
but I consider that a somewhat dirty work-around.

Is there anything else I can do to mend this?

-- 
There are only 10 different kinds of people in the world, 
those who understand binary, and those who don't.


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Does nfsd.o handle overwriting of files properly?
  2004-08-13  7:04 Does nfsd.o handle overwriting of files properly? Per Buer
@ 2004-08-13 16:06 ` Trond Myklebust
  0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2004-08-13 16:06 UTC (permalink / raw)
  To: Per Buer; +Cc: nfs

P=E5 fr , 13/08/2004 klokka 03:04, skreiv Per Buer:
> Hi.
>=20
> We have a daemon which does the following. Create a new file "foo" and re=
names=20
> this file to "bar". This happens on a nfs volume. The problem seems to be=
=20
> that we get "stale NFS handle" right after "bar" is overwritten.
>=20

That is fully expected behaviour for NFS. All implementations will do
the same thing, be it Solaris, Linux, IRIX,...

If you want the old file to be accessible, then the only workaround is
to rename it instead of deleting it (and that is precisely what most NFS
clients will do if you try to remove a file that is still held open by a
process on that client).

Cheers,
  Trond


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-13 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-13  7:04 Does nfsd.o handle overwriting of files properly? Per Buer
2004-08-13 16:06 ` Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.