]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
NFS: fix RENAME attr in presence of directory delegations
authorOlga Kornievskaia <okorniev@redhat.com>
Thu, 2 Apr 2026 23:12:36 +0000 (19:12 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 13 Apr 2026 21:43:28 +0000 (14:43 -0700)
Since commit 6f9bda2337f8 ("NFS: Fix directory delegation
verifier checks") xfstest generic/309 is failing because after
the rename (mv) operation, client's mtime/ctime is the same.
Update the delegated mtime when directory delegations are
present in rename.

Fixes: 6f9bda2337f8 ("NFS: Fix directory delegation verifier checks")
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Reviewed-by: Benjamin Coddington <bcodding@hammerspace.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c
fs/nfs/nfs4proc.c

index 3a5bba7e3c92d4d4fcd65234cd2f10e56f78dee0..43a0543364b8efa8c4cde2f076b7a35417acb8c6 100644 (file)
@@ -692,7 +692,8 @@ void nfs_update_delegated_atime(struct inode *inode)
 
 void nfs_update_delegated_mtime_locked(struct inode *inode)
 {
-       if (nfs_have_delegated_mtime(inode))
+       if (nfs_have_delegated_mtime(inode) ||
+           nfs_have_directory_delegation(inode))
                nfs_update_mtime(inode);
 }
 
index 768de9935ff16ac87dd6eb66d549e66acbf42679..dd800403a7cecc883edbc612146419c1184ab5e3 100644 (file)
@@ -5052,6 +5052,7 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
                                        res->new_fattr->time_start,
                                        NFS_INO_INVALID_NLINK |
                                            NFS_INO_INVALID_DATA);
+                       nfs_update_delegated_mtime(new_dir);
                } else
                        nfs4_update_changeattr(old_dir, &res->old_cinfo,
                                        res->old_fattr->time_start,