From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: "Patrick J. LoPresti" <lopresti@gmail.com>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nfs: lookupcache coherence bugs in WCC update path (revised)
Date: Thu, 12 Aug 2010 11:49:55 -0400 [thread overview]
Message-ID: <1281628195.2873.12.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <8762zgmmer.fsf@patl.com>
On Wed, 2010-08-11 at 22:26 -0700, Patrick J. LoPresti wrote:
> (Well, crud. I screwed up the previous diff and was missing a
> close-curly. This version actually compiles...)
>
> This patch fixes some coherence bugs in the NFS "dentry lookup cache".
>
> The NFS dentry lookup cache provides the nfs_force_lookup_revalidate()
> call to invalidate all cached dentries associated with an inode. In
> general, the NFS client uses the ctime and mtime in the inode to detect
> when changes are made on the server.
>
> Therefore, to maintain cache coherence, nfs_force_lookup_revalidate()
> must be called whenever the ctime or mtime of a directory inode is
> updated with fresh data from the server. There are a few spots in
> nfs_wcc_update_inode() where this rule is violated, making it possible
> for the lookup cache to return arbitrarily stale data.
>
> This actually bit me in practice. I have an application where a
> negative dentry results in -ENOENT for a file that was created 30+
> minutes earlier (despite the "noac" mount option). Unfortunately I
> cannot share my test case, but I believe the following simple patch is
> "obviously correct", and I can confirm that it fixes my issue.
This looks less than obviously correct to me. The wcc case is invoked
when the ctime/mtime/.... change is known to have occurred due to a file
creation/unlink/... from this client. It is a weak cache consistency
case.
If your client is seeing ENOENT after it created the file itself, then
the problem isn't cache coherency, but a bug in the file creation code.
Cheers
Trond
next prev parent reply other threads:[~2010-08-12 15:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-11 23:02 [PATCH] nfs: lookupcache coherence bugs in WCC update path Patrick J. LoPresti
2010-08-12 5:26 ` [PATCH] nfs: lookupcache coherence bugs in WCC update path (revised) Patrick J. LoPresti
2010-08-12 15:49 ` Trond Myklebust [this message]
2010-08-12 17:13 ` Patrick J. LoPresti
2010-08-12 17:26 ` Trond Myklebust
2010-08-12 17:48 ` Patrick J. LoPresti
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=1281628195.2873.12.camel@heimdal.trondhjem.org \
--to=trond.myklebust@fys.uio.no \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=lopresti@gmail.com \
/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
all inboxes | Powered by JetHome®