Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: Olga Kornievskaia <okorniev@redhat.com>
To: trond.myklebust@hammerspace.com, anna@kernel.org
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 1/1] NFSv4.2: fix COPY attrs in presence of delegated timestamps
Date: Fri, 27 Mar 2026 12:57:57 -0400	[thread overview]
Message-ID: <20260327165757.28948-1-okorniev@redhat.com> (raw)

A similar to generic/407 test can be done with a COPY operation
instead of CLONE (reflink). And it leads to same problem that ctime
and mtime saved before doing a "cp" operation are the same as after.

Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
---
 fs/nfs/nfs42proc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index f77372a78be7..ea420dc94875 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -502,6 +502,12 @@ static ssize_t _nfs42_proc_copy(struct file *src,
 
 	nfs42_copy_dest_done(dst, pos_dst, res->write_res.count, oldsize_dst);
 	nfs_invalidate_atime(src_inode);
+	if (nfs_have_delegated_attributes(dst_inode)) {
+		nfs_update_delegated_mtime(dst_inode);
+		spin_lock(&dst_inode->i_lock);
+		nfs_set_cache_invalid(dst_inode, NFS_INO_INVALID_BLOCKS);
+		spin_unlock(&dst_inode->i_lock);
+	}
 	status = res->write_res.count;
 out:
 	if (args->sync)
-- 
2.52.0


             reply	other threads:[~2026-03-27 16:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27 16:57 Olga Kornievskaia [this message]
2026-03-27 17:08 ` [PATCH 1/1] NFSv4.2: fix COPY attrs in presence of delegated timestamps Olga Kornievskaia
2026-04-03 13:43   ` Jeff Layton
2026-04-08 19:05 ` Olga Kornievskaia
2026-04-13 21:23 ` Trond Myklebust

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=20260327165757.28948-1-okorniev@redhat.com \
    --to=okorniev@redhat.com \
    --cc=anna@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).