linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] vfs: recall-only directory delegations for knfsd
@ 2025-10-13 14:47 Jeff Layton
  2025-10-13 14:47 ` [PATCH 01/13] filelock: push the S_ISREG check down to ->setlease handlers Jeff Layton
                   ` (13 more replies)
  0 siblings, 14 replies; 31+ messages in thread
From: Jeff Layton @ 2025-10-13 14:47 UTC (permalink / raw)
  To: Miklos Szeredi, Alexander Viro, Christian Brauner, Jan Kara,
	Chuck Lever, Alexander Aring, Trond Myklebust, Anna Schumaker,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Tom Talpey, Bharath SM, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich, David Howells, Tyler Hicks, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Amir Goldstein, Namjae Jeon,
	Steve French, Sergey Senozhatsky, Carlos Maiolino,
	Kuniyuki Iwashima, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: linux-fsdevel, linux-kernel, linux-nfs, linux-cifs,
	samba-technical, netfs, ecryptfs, linux-unionfs, linux-xfs,
	netdev, Jeff Layton

At the fall NFS Bakeathon last week, the NFS client and server
maintainers had a discussion about how to merge support for directory
delegations. We decided to start with just merging support for simple,
recallable-only directory delegation support, for a number of reasons:

1/ RFC8881 has some gaps in coverage that we are hoping to have
addressed in RFC8881bis. In particular, it's written such that CB_NOTIFY
callbacks require directory position information. That will be hard to
do properly under Linux, so we're planning to extend the spec to allow
that information to be omitted.

2/ client-side support for CB_NOTIFY still lags a bit. The client side
is tricky, as it involves heuristics about when to request a delegation.

3/ we have some early indication that simple, recallable-only
delegations can help performance in some cases. Anna mentioned seeing a
multi-minute speedup in xfstests runs with them enabled. This needs more
investigation, but it's promising and seems like enough justification to
merge support.

This patchset is quite similar to the set I initially posted back in
early 2024 [1]. We've merged some GET_DIR_DELEGATION handling patches
since then, but the VFS layer support is basically the same.

One thing that I want to make clear is that with this patchset, userspace
can request a read lease on a directory that will be recalled on
conflicting accesses. I saw no reason to prevent this, and I think it may
be something useful for applications like Samba.

As always, users can disable leases altogether via the fs.leases-enable
sysctl if this is an issue, but I wanted to point this out in case
anyone sees footguns here.

It would be great if we could get into linux-next soon so that it can be
merged for v6.19. Christian, could you pick up the vfs/filelock patches,
and Chuck pick up the nfsd patches?

Thanks!

[1]: https://lore.kernel.org/all/20240315-dir-deleg-v1-0-a1d6209a3654@kernel.org/

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Jeff Layton (13):
      filelock: push the S_ISREG check down to ->setlease handlers
      filelock: add a lm_may_setlease lease_manager callback
      vfs: add try_break_deleg calls for parents to vfs_{link,rename,unlink}
      vfs: allow mkdir to wait for delegation break on parent
      vfs: allow rmdir to wait for delegation break on parent
      vfs: break parent dir delegations in open(..., O_CREAT) codepath
      vfs: make vfs_create break delegations on parent directory
      vfs: make vfs_mknod break delegations on parent directory
      filelock: lift the ban on directory leases in generic_setlease
      nfsd: allow filecache to hold S_IFDIR files
      nfsd: allow DELEGRETURN on directories
      nfsd: check for delegation conflicts vs. the same client
      nfsd: wire up GET_DIR_DELEGATION handling

 drivers/base/devtmpfs.c  |   6 +-
 fs/cachefiles/namei.c    |   2 +-
 fs/ecryptfs/inode.c      |   6 +-
 fs/fuse/dir.c            |   1 +
 fs/init.c                |   4 +-
 fs/locks.c               |  17 ++++-
 fs/namei.c               | 163 ++++++++++++++++++++++++++++++++++-------------
 fs/nfs/nfs4file.c        |   2 +
 fs/nfsd/filecache.c      |  50 +++++++++++----
 fs/nfsd/filecache.h      |   2 +
 fs/nfsd/nfs4proc.c       |  21 +++++-
 fs/nfsd/nfs4recover.c    |   6 +-
 fs/nfsd/nfs4state.c      | 114 ++++++++++++++++++++++++++++++++-
 fs/nfsd/state.h          |   5 ++
 fs/nfsd/vfs.c            |  11 ++--
 fs/nfsd/vfs.h            |   2 +-
 fs/overlayfs/overlayfs.h |   6 +-
 fs/smb/client/cifsfs.c   |   3 +
 fs/smb/server/vfs.c      |   6 +-
 fs/xfs/scrub/orphanage.c |   2 +-
 include/linux/filelock.h |  14 ++++
 include/linux/fs.h       |   9 +--
 net/unix/af_unix.c       |   2 +-
 23 files changed, 363 insertions(+), 91 deletions(-)
---
base-commit: 2c40814eb5ae104d3f898fd8b705ecad114105b5
change-id: 20251013-dir-deleg-ro-d0fe19823b21

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


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

end of thread, other threads:[~2025-10-20  9:38 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13 14:47 [PATCH 00/13] vfs: recall-only directory delegations for knfsd Jeff Layton
2025-10-13 14:47 ` [PATCH 01/13] filelock: push the S_ISREG check down to ->setlease handlers Jeff Layton
2025-10-14  5:37   ` NeilBrown
2025-10-14 11:07     ` Jeff Layton
2025-10-13 14:48 ` [PATCH 02/13] filelock: add a lm_may_setlease lease_manager callback Jeff Layton
2025-10-14  5:34   ` NeilBrown
2025-10-14 11:10     ` Jeff Layton
2025-10-14 22:10       ` NeilBrown
2025-10-15 11:35         ` Jeff Layton
2025-10-13 14:48 ` [PATCH 03/13] vfs: add try_break_deleg calls for parents to vfs_{link,rename,unlink} Jeff Layton
2025-10-20  9:38   ` Jan Kara
2025-10-13 14:48 ` [PATCH 04/13] vfs: allow mkdir to wait for delegation break on parent Jeff Layton
2025-10-20  9:38   ` Jan Kara
2025-10-13 14:48 ` [PATCH 05/13] vfs: allow rmdir " Jeff Layton
2025-10-20  9:38   ` Jan Kara
2025-10-13 14:48 ` [PATCH 06/13] vfs: break parent dir delegations in open(..., O_CREAT) codepath Jeff Layton
2025-10-20  9:38   ` Jan Kara
2025-10-13 14:48 ` [PATCH 07/13] vfs: make vfs_create break delegations on parent directory Jeff Layton
2025-10-13 20:33   ` Jeff Layton
2025-10-20  9:38   ` Jan Kara
2025-10-13 14:48 ` [PATCH 08/13] vfs: make vfs_mknod " Jeff Layton
2025-10-20  9:38   ` Jan Kara
2025-10-13 14:48 ` [PATCH 09/13] filelock: lift the ban on directory leases in generic_setlease Jeff Layton
2025-10-13 14:48 ` [PATCH 10/13] nfsd: allow filecache to hold S_IFDIR files Jeff Layton
2025-10-14  5:45   ` NeilBrown
2025-10-13 14:48 ` [PATCH 11/13] nfsd: allow DELEGRETURN on directories Jeff Layton
2025-10-13 14:48 ` [PATCH 12/13] nfsd: check for delegation conflicts vs. the same client Jeff Layton
2025-10-14  5:48   ` NeilBrown
2025-10-13 14:48 ` [PATCH 13/13] nfsd: wire up GET_DIR_DELEGATION handling Jeff Layton
2025-10-13 14:52 ` [PATCH 00/13] vfs: recall-only directory delegations for knfsd Chuck Lever
2025-10-13 15:26   ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).