[PATCH v2 00/11] nfsd: various delegated timestamp fixes

From: Jeff Layton

Date: Mon Nov 23 2026 - 07:59:37 EST


This version fixes up some bugs that Sashiko pointed out, as well as a
nit that Aurélien pointed out.

While I was reworking NFSD's delegated timestamp support, LLM review
found several bugs in the existing code. This series fixes them.

The timestamp rework is still a work in progress. These fixes can go in
ahead of it.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
Changes in v2:
- nfsd_setattr(): sanitize a fresh copy of the attributes under
inode_lock on each attempt, since the setid bits a chown must clear
depend on the current mode
- cb_getattr_update_times(): pin fi_deleg_file for the mount's write
access, and skip the update once the delegation is unhashed
- nfsd4_deleg_set_times(): set dl_setattr only after notify_change()
succeeds
- add the missing Signed-off-by to the nfsd_setattr() inode_lock patch
- reword changelogs and comments
- don't use ! operator on cl_minorversion
- Link to v1: https://lore.kernel.org/r/20261120-delegts-fixes-v1-0-c89b37d2d462@xxxxxxxxxx

---
Jeff Layton (11):
nfsd: don't hold inode_lock while waiting for a delegation in nfsd_setattr()
nfsd: take freeze protection before updating delegation timestamps
nfsd: count a delegation in cl_delegs_in_recall only once
nfsd: don't grant write delegations to NFSv4.0 clients on CLAIM_PREVIOUS
nfsd: set ctime when a SETATTR with delegated times changes other attributes
nfsd: pin the client while a GETATTR holds a conflicting delegation
nfsd: recall when a CB_GETATTR reply omits the size
nfsd: apply delegated times in a separate times-only setattr
nfsd: grant a plain read delegation when timestamps are wanted on a read open
nfsd: check fi_had_conflict under deleg_lock before hashing a delegation
nfsd: take the write delegation grant stat before hashing

fs/nfsd/nfs4callback.c | 1 +
fs/nfsd/nfs4proc.c | 171 ++++++++++++++++++++----------
fs/nfsd/nfs4state.c | 281 ++++++++++++++++++++++++++++++++++++++-----------
fs/nfsd/nfs4xdr.c | 56 +++++-----
fs/nfsd/state.h | 2 +
fs/nfsd/vfs.c | 62 ++++++-----
fs/nfsd/vfs.h | 1 +
fs/nfsd/xdr4.h | 3 +
8 files changed, 405 insertions(+), 172 deletions(-)
---
base-commit: 194069b5ff38d82d302c33a4dd280d948c96cfe6
change-id: 20261120-delegts-fixes-798331d91d8f

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