From: Trond Myklebust <trondmy@hammerspace.com>
To: "bcodding@redhat.com" <bcodding@redhat.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"anna.schumaker@netapp.com" <anna.schumaker@netapp.com>
Subject: Re: [PATCH 2/3] NFSv42: Don't drop NFS_INO_INVALID_CHANGE if we hold a delegation
Date: Tue, 16 Nov 2021 14:49:35 +0000 [thread overview]
Message-ID: <c5dddaa40131e350fad249c71890ea79df9cef06.camel@hammerspace.com> (raw)
In-Reply-To: <66EE327D-C8F1-44D0-9364-573CA1208D46@redhat.com>
On Tue, 2021-11-16 at 09:34 -0500, Benjamin Coddington wrote:
> On 16 Nov 2021, at 9:17, Trond Myklebust wrote:
>
> > On Tue, 2021-11-16 at 09:12 -0500, Benjamin Coddington wrote:
> > > On 16 Nov 2021, at 9:03, Trond Myklebust wrote:
> > > > No, we really shouldn't need to care what the server thinks or
> > > > does.
> > > > The client is authoritative for the change attribute while it
> > > > holds
> > > > a
> > > > delegation, not the server.
> > >
> > > My understanding of the intention of the code (which I had to
> > > sort of
> > > put
> > > together from historical patches in this area) is that we want to
> > > see
> > > ctime,
> > > mtime, and block size updates after copy/clone even if we hold a
> > > delegation,
> > > but without NFS_INO_INVALID_CHANGE, the client won't update those
> > > attributes.
> > >
> > > If that's not necessary, we can drop this patch.
> > >
> >
> > We will still see the ctime/mtime/block size updates even if
> > NFS_INO_INVALID_CHANGE is not set. Those attributes' cache status
> > are
> > tracked separately through their own NFS_INO_INVALID_* bits.
> >
> > That said, there really is no reason why we shouldn't treat the
> > copy
> > and clone code exactly the same way we would treat a regular write.
> > Perhaps we can fix up the arguments of nfs_writeback_update_inode()
> > so
> > that it can be called here?
>
> I wonder if that just kicks the problem down the road to when we
> return the
> delegation, and we'll see cases where ctime/mtime move backward. And
> I
> don't think we can ever be authoritative for space_used, but maybe it
> doesn't
> matter if we're within the attribute timeouts.
>
I don't understand your point. Mine is that we _should_ be setting the
NFS_INO_INVALID_MTIME, NFS_INO_INVALID_CTIME, NFS_INO_INVALID_BLOCKS...
flags here, and as far as I can tell, we are indeed doing so in
nfs42_copy_dest_done().
At least for clone(), we're then calling nfs_post_op_update_inode(),
which updates the attributes with whatever was retrieved in the CLONE
call. That will usually contain new values for mtime, ctime and blocks,
and so the cache is refreshed.
If the client failed to retrieve attributes as part of the CLONE or
COPY call, then we are indeed kicking the can of revalidating the
attributes down the road, but only as far as until the next call to
nfs_getattr(), or the delegation return, whichever comes first. The
fact that we do set the NFS_INO_INVALID_MTIME, ... means that we will
update those cached values before replying to a stat() or statx() call.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2021-11-16 14:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 13:49 [PATCH 0/3] COPY/CLONE pagecache invalidation Benjamin Coddington
2021-11-16 13:49 ` [PATCH 1/3] NFSv42: Fix pagecache invalidation after COPY/CLONE Benjamin Coddington
2021-11-16 13:57 ` Trond Myklebust
2021-11-16 14:01 ` Benjamin Coddington
2021-11-16 14:06 ` Benjamin Coddington
2021-11-16 15:26 ` Trond Myklebust
2021-11-16 13:49 ` [PATCH 2/3] NFSv42: Don't drop NFS_INO_INVALID_CHANGE if we hold a delegation Benjamin Coddington
2021-11-16 14:03 ` Trond Myklebust
2021-11-16 14:12 ` Benjamin Coddington
2021-11-16 14:17 ` Trond Myklebust
2021-11-16 14:34 ` Benjamin Coddington
2021-11-16 14:49 ` Trond Myklebust [this message]
2021-11-16 15:15 ` Benjamin Coddington
2021-11-16 13:49 ` [PATCH 3/3] NFS: Add a tracepoint to show the results of nfs_set_cache_invalid() Benjamin Coddington
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=c5dddaa40131e350fad249c71890ea79df9cef06.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=anna.schumaker@netapp.com \
--cc=bcodding@redhat.com \
--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