From: Trond Myklebust <trondmy@kernel.org>
To: Olga Kornievskaia <okorniev@redhat.com>, anna@kernel.org
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/1] NFSv4.2: fix CLONE attrs in presence of delegated attributes
Date: Mon, 13 Apr 2026 14:21:29 -0700 [thread overview]
Message-ID: <80f40bb9a8ed1c1933d7014d626b1609000ff353.camel@kernel.org> (raw)
In-Reply-To: <20260327151149.25317-1-okorniev@redhat.com>
On Fri, 2026-03-27 at 11:11 -0400, Olga Kornievskaia wrote:
> xfstest generic/407 is failing in 2 ways. It detects that after
> doing a clone the client does not update it's mtime and it's ctime.
> CLONE always sends a GETATTR operation and then calls
> nfs_post_op_update_inode() based on the returned attributes.
> Because of the delegated attributes the client ignores updating
> the mtime. Then also, when delegated attributes are present, for
> the change_attr the server replies with the same values as what
> the client cached before and thus the generic/407 would flag that.
> Instead, make sure we invalidate the blocks attr.
>
> Fixes: e12912d94137 ("NFSv4: Add support for delegated atime and
> mtime attributes")
> Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
> ---
> fs/nfs/nfs42proc.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
> index 7e5c1172fc11..f6a7cfa12225 100644
> --- a/fs/nfs/nfs42proc.c
> +++ b/fs/nfs/nfs42proc.c
> @@ -1306,7 +1306,15 @@ static int _nfs42_proc_clone(struct
> rpc_message *msg, struct file *src_f,
> if (count == 0 && res.dst_fattr->valid &
> NFS_ATTR_FATTR_SIZE)
> count = nfs_size_to_loff_t(res.dst_fattr-
> >size) - dst_offset;
> nfs42_copy_dest_done(dst_f, dst_offset, count,
> oldsize_dst);
> - status = nfs_post_op_update_inode(dst_inode,
> res.dst_fattr);
> + nfs_update_delegated_mtime(dst_inode);
> + if (!nfs_have_delegated_attributes(dst_inode))
> + status = nfs_post_op_update_inode(dst_inode,
> +
> res.dst_fattr);
> + else {
> + spin_lock(&dst_inode->i_lock);
> + nfs_set_cache_invalid(dst_inode,
> NFS_INO_INVALID_BLOCKS);
> + spin_unlock(&dst_inode->i_lock);
> + }
Why not call nfs_post_op_update_inode() instead of setting
NFS_INO_INVALID_BLOCKS? It should be safe to do so.
> }
>
> kfree(res.dst_fattr);
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trondmy@kernel.org, trond.myklebust@hammerspace.com
prev parent reply other threads:[~2026-04-13 21:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 15:11 [PATCH 1/1] NFSv4.2: fix CLONE attrs in presence of delegated attributes Olga Kornievskaia
2026-04-08 19:03 ` Olga Kornievskaia
2026-04-13 21:21 ` Trond Myklebust [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=80f40bb9a8ed1c1933d7014d626b1609000ff353.camel@kernel.org \
--to=trondmy@kernel.org \
--cc=anna@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=okorniev@redhat.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