Skip to contentSkip to conversation

NFSv4.2: fix CLONE/COPY attrs in presence of delegated attributes

PATCH New Olga Kornievskaia 1 participant 1 message Apr 17

Subsystems (2)
lore
Share & tools
lore

Olga Kornievskaia

author reviewer
#0 lore raw

PATCH v5 1/1 NFSv4.2: fix CLONE/COPY attrs in presence of delegated attributes

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.

By adding updating delegated attributes in nfs42_copy_dest_done() both COPY and CLONE would update mtime appropriately.

Fixes e12912d94137 ("NFSv4: Add support for delegated atime and mtime attributes")

--v5 change nfs_update_delegated_mtime() placement --v4 this version removes the need for having "NFSv4.2: fix COPY attrs in presence of delegated timestamps"

---
 fs/nfs/nfs42proc.c | 1 +
 1 file changed, 1 insertion(+)
fs/nfs/nfs42proc.c +1 -0
index 7b3ca68fb4bb..6e195619a232 100644
@@ -401,6 +401,7 @@ static void nfs42_copy_dest_done(struct file *file, loff_t pos, loff_t len,
 					     NFS_INO_INVALID_MTIME |
 					     NFS_INO_INVALID_BLOCKS);
 	spin_unlock(&inode->i_lock);
+	nfs_update_delegated_mtime(inode);
 }
 
 static ssize_t _nfs42_proc_copy(struct file *src,
Signature · 1 line
2.52.0