Linux NFS development
 help / color / mirror / Atom feed
From: "Benjamin Coddington" <bcodding@redhat.com>
To: "Trond Myklebust" <trondmy@hammerspace.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: client lookup_revalidate bug
Date: Thu, 30 May 2019 09:44:03 -0400	[thread overview]
Message-ID: <19F37AE9-C66F-4F2A-9048-ADC6021B1148@redhat.com> (raw)
In-Reply-To: <30D343CF-50AD-4470-84D5-C825EB00B5C9@redhat.com>

On 30 May 2019, at 6:35, Benjamin Coddington wrote:

> On 29 May 2019, at 13:19, Trond Myklebust wrote:
>> On Wed, 2019-05-29 at 12:39 -0400, Benjamin Coddington wrote:
>>> On 29 May 2019, at 12:21, Trond Myklebust wrote:
>>
>> Sorry, but that's not the case, because of the abuse of the
>> nosharecache flag. You are manipulating the file on the server and
>> expecting an immediate cache invalidation. That would require
>> information that the client does not have.
>
> Yes, forget about the nosharecache flag.  Let's just assume we move 
> the file
> on the server.  The client does perform a GETATTR and sees the updated
> change_attr for the directory, but it matches the dentry's new d_time.
>
> I don't expect immediate cache invalidation; invalidation will never 
> happen
> as long as B/'s change_attr isn't bumped again.  On the client, B/foo
> dentry's d_time is the same as the change_attr for B/, and even though
> there's no file at B/foo on the server, the client will keep the B/foo
> dentry until something else bumps B/'s change_attr.
>
> Maybe I need to imagine a scenario where this matters more..
>
> But, I think that if we use the method of comparing d_time with the 
> parent's
> change_attr to determine if we need to lookup, this is a case where 
> that's
> not reliable.
>
> I'll try to come up with something as I have time to work on it since 
> I am
> getting pressure about it.  It looks to me like this behavior has been
> around for a long time.  Thanks for the look.

Takayuki Nagata points out that this behavior only happens when we have 
a
read delegation, and it seems obvious that we ought to skip lookup
revalidation if so.

Let me see if I can clarify the order of events so anyone that wishes 
can
better argue about what should happen.

Single client, NFS is mounted on /mnt

Client reads /mnt/A/foo, dentry A/foo is hashed.
Client moves /mnt/A/foo to /mnt/B/foo, dentry B/foo is hashed.
Server moves B/foo back to A/foo.
Client reads A/foo, gets a read delegation.
Client looks up B/foo, skips revalidation because it holds the read 
delegation.

Client will always return a positive lookup for both A/foo and B/foo at 
this
point.

Should this happen?  My position is no, it shouldn't.

      reply	other threads:[~2019-05-30 13:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 15:08 client lookup_revalidate bug Benjamin Coddington
2019-05-29 16:21 ` Trond Myklebust
2019-05-29 16:39   ` Benjamin Coddington
2019-05-29 17:02     ` Achilles Gaikwad
2019-05-29 17:19     ` Trond Myklebust
2019-05-30 10:35       ` Benjamin Coddington
2019-05-30 13:44         ` Benjamin Coddington [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=19F37AE9-C66F-4F2A-9048-ADC6021B1148@redhat.com \
    --to=bcodding@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@hammerspace.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