[PATCH v2 0/5] nfsd: more delegated timestamp fixes

From: Jeff Layton

Date: Fri Nov 06 2026 - 15:41:38 EST


Chuck recently added a new DELEG27 pynfs test that fails against nfsd.
These patches fix the behavior of delegated timestamps (again), such
that DELEG27 now passes.

I also ran some tests with the git regression testsuite which turns out
to be very sensitive to timestamp bugs, and that turned up a few more
server-side bugs.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
Changes in v2:
- "Honor delegated timestamps when change and size match" reworked:
- set ATTR_FORCE when applying the holder's times
- record applied times in dl_[amc]time; vet and record under inode_lock
- vet SETATTR's delegated times in nfsd_setattr() under inode_lock
- also mark file modified on a holder WRITE whose mtime didn't pass dl_mtime
- always report ncf_initial_cinfo as the change attr for timestamp delegations
- catch the holder's own server-side changes (SETATTR, xattrs, etc.)
via a change attribute saved at grant
- log, rather than fail the GETATTR, if applying the holder's times fails
- New: don't stamp over an applied delegated mtime at DELEGRETURN
- New: don't vet delegated times against an exclusive-create verifier
- New: mark the delegation written on COPY/CLONE instead of stamping c/mtime
- Link to v1: https://lore.kernel.org/r/20261102-deleg-cb-getattr-times-v1-0-ca0326d88623@xxxxxxxxxx

---
Jeff Layton (5):
nfsd: Report vetted delegated timestamps in GETATTR replies
nfsd: Honor delegated timestamps when change and size match
nfsd: don't stamp over an applied delegated mtime at DELEGRETURN
nfsd: don't vet delegated times against an exclusive-create verifier
nfsd: mark the delegation written on COPY/CLONE instead of stamping c/mtime

fs/nfsd/nfs4proc.c | 98 ++++++++++++++---------------
fs/nfsd/nfs4state.c | 173 +++++++++++++++++++++++++++++++++++++++++++++-------
fs/nfsd/nfs4xdr.c | 10 +--
fs/nfsd/state.h | 5 +-
fs/nfsd/vfs.c | 4 ++
fs/nfsd/vfs.h | 13 ++++
fs/nfsd/xdr4.h | 9 ++-
7 files changed, 229 insertions(+), 83 deletions(-)
---
base-commit: d692f252c52b8d1b4bc7481554f314df31ed8249
change-id: 20261102-deleg-cb-getattr-times-8aa926029b16

Best regards,
--
Jeff Layton <jlayton@xxxxxxxxxx>