public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: NFS <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] NFS: revalidate on open if dcache is negative.
Date: Tue, 13 May 2014 10:41:47 +1000	[thread overview]
Message-ID: <20140513104147.144ce93a@notabene.brown> (raw)
In-Reply-To: <5C29EB03-6EF6-476C-AD25-97E0A3871C26@primarydata.com>

[-- Attachment #1: Type: text/plain, Size: 1869 bytes --]

On Mon, 12 May 2014 13:58:59 -0700 Trond Myklebust
<trond.myklebust@primarydata.com> wrote:

> 
> On May 11, 2014, at 20:50, NeilBrown <neilb@suse.de> wrote:
> 
> > 
> > 
> > NFS CTO semantics require that (absent a delegation) the server
> > must be contacted at each open.
> > 
> > nfs_lookup_verify_inode() implements this when the dcache contains
> > a positive cached entry.  However it is not called when the dcache
> > contains a negative cached entry.  That path uses nfs_neg_need_reval()
> > which doesn't impose CTO semantics.
> > 
> > So a sequence like:
> > 
> >   rm -f testfile
> >   ls -l testfile
> >   ssh $server touch testfile
> >   cat testfile
> > 
> > will fail:
> > 
> >  cat: testfile: No such file or directory
> > 
> > an 'strace' will confirm that this resulted from an 'open' system
> > call.
> > 
> > So add code to nfs_neg_need_reval implement CTO semantics much like
> > that in nfs_lookup_verify_inode().
> 
> Hi Neil,
> 
> To me, close-to-open is about ensuring that the data and metadata caches for the file (or directory) in question are revalidated correctly on open (or opendir). Close-to-open semantics are enabled/disabled by the cto/nocto mount options (with cto being the default).
> 
> The lookup semantics are about ensuring that the namespace cache is consistent with what is on the server. They are controlled by the ‘lookupcache’ mount option, which defaults to the behaviour that you describe above (lookupcache=all). I believe that we have discussed changing the default to be lookupcache=positive, which would give the semantics that your patch enforces, but I believe the consensus was to keep the current behaviour.
> 

Yes - of course.  Thanks for clarifying that for me.
I had in mind that lookup-for-open is special.  It is, but not that special.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2014-05-13  0:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12  3:50 [PATCH] NFS: revalidate on open if dcache is negative NeilBrown
2014-05-12 20:58 ` Trond Myklebust
2014-05-13  0:41   ` NeilBrown [this message]

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=20140513104147.144ce93a@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.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