mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/8] nfsd: more delegated timestamp fixes
@ 2026-11-09 20:36 Jeff Layton
  2026-11-09 20:36 ` [PATCH v3 1/8] nfsd: Report vetted delegated timestamps in GETATTR replies Jeff Layton
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Jeff Layton @ 2026-11-09 20:36 UTC (permalink / raw)
  To: Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Alexander Viro, Christian Brauner, Jan Kara
  Cc: Tom Haynes, linux-nfs, linux-kernel, linux-fsdevel, Jeff Layton

This version fixes the existing patches and adds some new ones to fix
problems that agentic review spotted. Note that there is also a
companion client-side series that fixes some related issues.

The catch with this version is that we need a fix to
inode_set_ctime_deleg(), and that lives in fs/inode.c. We'll either need
to get Christian to take that one or get his blessing to merge it via
the nfsd tree. It's a pretty small patch, so the latter might be OK.

Original cover letter follows:

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@kernel.org>
---
Changes in v3:
- "Honor delegated timestamps when change and size match":
  - record applied times from SETATTR too, so a stale CB_GETATTR reply
    can't move them backward
  - record ctime from the inode; atime/mtime from the untruncated values
  - move the vet/record prototypes to nfs4ctl.h
- "don't stamp over an applied delegated mtime at DELEGRETURN":
  - share the vetting between SETATTR and CB_GETATTR
  - set dl_setattr only after the holder's mtime is applied
  - test dl_setattr under inode_lock at DELEGRETURN
- "don't vet delegated times against an exclusive-create verifier":
  also set the floors for read timestamp delegations
- "mark the delegation written on COPY/CLONE instead of stamping c/mtime":
  - look up the nfs4_file for every async COPY
  - remove the now-unused nfsd_update_cmtime_attr()
- New: fs: check a fine-grained time before clamping a delegated ctime
- New: nfsd: check a fine-grained time before clamping a delegated mtime
- New: nfsd: raise delegated time floors after a size-changing SETATTR
- Kernel-doc, comment and commit message fixes
- Link to v2: https://lore.kernel.org/r/20261106-deleg-cb-getattr-times-v2-0-8433618ab9a1@kernel.org

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@kernel.org

---
Jeff Layton (8):
      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: check a fine-grained time before clamping a delegated ctime
      nfsd: check a fine-grained time before clamping a delegated mtime
      nfsd: raise delegated time floors after a size-changing SETATTR

 fs/inode.c             |  16 ++-
 fs/nfsd/nfs4callback.c |   2 +-
 fs/nfsd/nfs4ctl.h      |  15 +++
 fs/nfsd/nfs4proc.c     | 101 +++++++++--------
 fs/nfsd/nfs4state.c    | 292 +++++++++++++++++++++++++++++++++++++------------
 fs/nfsd/nfs4xdr.c      |  10 +-
 fs/nfsd/state.h        |   6 +-
 fs/nfsd/vfs.c          |   6 +
 fs/nfsd/vfs.h          |   4 +
 fs/nfsd/xdr4.h         |   9 +-
 10 files changed, 325 insertions(+), 136 deletions(-)
---
base-commit: d692f252c52b8d1b4bc7481554f314df31ed8249
change-id: 20261102-deleg-cb-getattr-times-8aa926029b16

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-09 20:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 20:36 [PATCH v3 0/8] nfsd: more delegated timestamp fixes Jeff Layton
2026-11-09 20:36 ` [PATCH v3 1/8] nfsd: Report vetted delegated timestamps in GETATTR replies Jeff Layton
2026-11-09 20:36 ` [PATCH v3 2/8] nfsd: Honor delegated timestamps when change and size match Jeff Layton
2026-11-09 20:36 ` [PATCH v3 3/8] nfsd: don't stamp over an applied delegated mtime at DELEGRETURN Jeff Layton
2026-11-09 20:36 ` [PATCH v3 4/8] nfsd: don't vet delegated times against an exclusive-create verifier Jeff Layton
2026-11-09 20:36 ` [PATCH v3 5/8] nfsd: mark the delegation written on COPY/CLONE instead of stamping c/mtime Jeff Layton
2026-11-09 20:36 ` [PATCH v3 6/8] fs: check a fine-grained time before clamping a delegated ctime Jeff Layton
2026-11-09 20:36 ` [PATCH v3 7/8] nfsd: check a fine-grained time before clamping a delegated mtime Jeff Layton
2026-11-09 20:36 ` [PATCH v3 8/8] nfsd: raise delegated time floors after a size-changing SETATTR Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®