public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] NFSv4.2: fix COPY attrs in presence of delegated timestamps
@ 2026-03-27 16:57 Olga Kornievskaia
  2026-03-27 17:08 ` Olga Kornievskaia
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Olga Kornievskaia @ 2026-03-27 16:57 UTC (permalink / raw)
  To: trond.myklebust, anna; +Cc: linux-nfs

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-13 21:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27 16:57 [PATCH 1/1] NFSv4.2: fix COPY attrs in presence of delegated timestamps Olga Kornievskaia
2026-03-27 17:08 ` Olga Kornievskaia
2026-04-03 13:43   ` Jeff Layton
2026-04-08 19:05 ` Olga Kornievskaia
2026-04-13 21:23 ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox