Skip to content

nfsd: various delegated timestamp fixes

Jeff Layton linux-nfs lkml 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20261120-delegts-fixes-798331d91d8f

Versions newest first

  1. v3 Latest12 patches 1 replyIn review
  2. v211 patches 2 repliesSuperseded
  3. v111 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- nfsd4_finalize_deleg_timestamps(): wait for a thaw on DELEGRETURN
- vet_deleg_attrs(): set dl_setattr on any applied delegated mtime
- nfsd4_deleg_set_times(): likewise set dl_setattr on an applied mtime
- new patch: move ctime when CB_GETATTR applies a delegated mtime
- Link to v2: https://lore.kernel.org/r/[email protected]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12nfsd: don't hold inode_lock while waiting for a delegation in nfsd_setattr()fs/nfsd/vfs.c+31 -170 replies
2/12nfsd: take freeze protection before updating delegation timestampsfs/nfsd/nfs4state.c+93 -280 replies
3/12nfsd: count a delegation in cl_delegs_in_recall only oncefs/nfsd/nfs4state.c+14 -60 replies
4/12nfsd: don't grant write delegations to NFSv4.0 clients on CLAIM_PREVIOUSfs/nfsd/nfs4state.c+3 -00 replies
5/12nfsd: set ctime when a SETATTR with delegated times changes other attributesfs/nfsd/nfs4proc.c fs/nfsd/vfs.c+8 -60 replies
6/12nfsd: pin the client while a GETATTR holds a conflicting delegationfs/nfsd/nfs4state.c fs/nfsd/nfs4xdr.c fs/nfsd/state.h+40 -40 replies
7/12nfsd: recall when a CB_GETATTR reply omits the sizefs/nfsd/nfs4callback.c fs/nfsd/nfs4state.c fs/nfsd/state.h+10 -00 replies
8/12nfsd: apply delegated times in a separate times-only setattrfs/nfsd/nfs4proc.c fs/nfsd/nfs4xdr.c fs/nfsd/vfs.c +2 more+152 -930 replies
9/12nfsd: grant a plain read delegation when timestamps are wanted on a read openfs/nfsd/nfs4state.c+6 -40 replies
10/12nfsd: check fi_had_conflict under deleg_lock before hashing a delegationfs/nfsd/nfs4state.c+11 -10 replies
11/12nfsd: take the write delegation grant stat before hashingfs/nfsd/nfs4state.c+63 -300 replies
12/12nfsd: move ctime when CB_GETATTR applies a delegated mtimefs/nfsd/nfs4state.c+3 -20 replies

Reviews trailers per patch

1 of 12 patches has a Reviewed-by or Acked-by.

PatchAurélien Couderc
1/12
2/12
3/12
4/12R-b
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/12] nfsd: various delegated timestamp fixes

v3 fixes two problems in the v2 freeze protection and SETATTR ctime patches, and adds a patch for the same ctime bug in CB_GETATTR.

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.

---
Changes in v3:
- nfsd4_finalize_deleg_timestamps(): wait for a thaw on DELEGRETURN
- vet_deleg_attrs(): set dl_setattr on any applied delegated mtime
- nfsd4_deleg_set_times(): likewise set dl_setattr on an applied mtime
- new patch: move ctime when CB_GETATTR applies a delegated mtime
- Link to v2: https://lore.kernel.org/r/[email protected]

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/[email protected]

---
Jeff Layton (12):
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
nfsd: move ctime when CB_GETATTR applies a delegated mtime

 fs/nfsd/nfs4callback.c |   1 +
 fs/nfsd/nfs4proc.c     | 171 ++++++++++++++++++---------
 fs/nfsd/nfs4state.c    | 313 +++++++++++++++++++++++++++++++++++++------------
 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, 426 insertions(+), 183 deletions(-)

---
base-commit: 194069b5ff38d82d302c33a4dd280d948c96cfe6
change-id: 20261120-delegts-fixes-798331d91d8f

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>