]> git.ipfire.org Git - thirdparty/linux.git/commit
nfs: fix utimensat() for atime with delegated timestamps
authorJeff Layton <jlayton@kernel.org>
Tue, 24 Mar 2026 17:32:11 +0000 (13:32 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 13 Apr 2026 18:46:01 +0000 (11:46 -0700)
commit16d99dce938ecbbc703843a31fb951acca46af27
treec7f50913c62fb0eeed5bda543ef3985da6cbcd82
parent3a06bac55bf56290673ea67abe3d285f0ab3837a
nfs: fix utimensat() for atime with delegated timestamps

xfstest generic/221 is failing with delegated timestamps enabled.  When
the client holds a WRITE_ATTRS_DELEG delegation, and a userland process
does a utimensat() for only the atime, the ctime is not properly
updated. The problem is that the client tries to cache the atime update,
but there is no mtime update, so the delegated attribute update never
updates the ctime.

Delegated timestamps don't have a mechanism to update the ctime in
accordance with atime-only changes due to utimensat() and the like.
Change the client to issue an RPC in this case, so that the ctime gets
properly updated alongside the atime.

Fixes: 40f45ab3814f ("NFS: Further fixes to attribute delegation a/mtime changes")
Reported-by: Olga Kornievskaia <aglo@umich.edu>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c