From: Peter Staubach <staubach@redhat.com>
To: Charles Duffy <charles-7s4ginpmXnFeoWH0uzbU5w@public.gmane.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: Apparent race condition w/ NFSv3 mktemp+write+rename
Date: Tue, 24 Nov 2009 15:03:04 -0500 [thread overview]
Message-ID: <4B0C3BF8.1070904@redhat.com> (raw)
In-Reply-To: <hehc8g$k8f$1@ger.gmane.org>
Charles Duffy wrote:
> 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?
>
At the end, does /mnt/foobar exist and contain the string, "baz"?
What mount options are being used on the client?
It sounds to me as if the duplicate request cache on the server
is not working, perhaps because entries are being recycled too
quickly, and does not catch a retransmitted RENAME operation.
Thanx...
ps
next prev parent reply other threads:[~2009-11-24 20:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B0C3BF8.1070904@redhat.com \
--to=staubach@redhat.com \
--cc=charles-7s4ginpmXnFeoWH0uzbU5w@public.gmane.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox