public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* Apparent race condition w/ NFSv3 mktemp+write+rename
@ 2009-11-24 19:26 Charles Duffy
  2009-11-24 20:03 ` Jeff Layton
  2009-11-24 20:03 ` Peter Staubach
  0 siblings, 2 replies; 8+ messages in thread
From: Charles Duffy @ 2009-11-24 19:26 UTC (permalink / raw)
  To: linux-nfs

Howdy. With a very heavily loaded (CentOS 5 - Linux 2.6.18-128.el5) 
NFSv3 client and server, I've experienced the following sporadic issue:

function atomic_write() {
     local filename="$1"
     local tempfile
     tempfile="$(mktemp "${filename}.XXXXXX")"
     cat >"${tempfile}" && mv "${tempfile}" "${filename}"
}

$ atomic_write /mnt/foobar <<<"baz"
mv: cannot move `/mnt/foobar.gO1881' to `/mnt/foobar': No such file or 
directory

Are my assumptions regarding available semantics fair and reasonable?


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

end of thread, other threads:[~2009-11-24 20:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24 19:26 Apparent race condition w/ NFSv3 mktemp+write+rename Charles Duffy
2009-11-24 20:03 ` Jeff Layton
2009-11-24 20:04   ` Jeff Layton
2009-11-24 20:03 ` Peter Staubach
2009-11-24 20:24   ` Charles Duffy
     [not found]     ` <4B0C4116.10903-7s4ginpmXnFeoWH0uzbU5w@public.gmane.org>
2009-11-24 20:30       ` Peter Staubach
2009-11-24 20:36         ` Charles Duffy
     [not found]           ` <4B0C43D5.7000103-7s4ginpmXnFeoWH0uzbU5w@public.gmane.org>
2009-11-24 20:44             ` Peter Staubach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox