public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] sunrpc: not refcounting svc_serv
@ 2023-10-30  1:08 NeilBrown
  2023-10-30  1:08 ` [PATCH 1/5] nfsd: call nfsd_last_thread() before final nfsd_put() NeilBrown
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: NeilBrown @ 2023-10-30  1:08 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton
  Cc: linux-nfs, Olga Kornievskaia, Dai Ngo, Tom Talpey

This patch set continues earlier work of improving how threads and
services are managed.  Specifically it drop the refcount.

The refcount is always changed under the mutex, and almost always is
exactly equal to the number of threads.  Those few cases where it is
more than the number of threads can usefully be handled other ways as
see in the patches.

The first patches fixes a potential use-after-free when adding a socket
fails.  This might be the UAF that Jeff mentioned recently.

The second patch which removes the use of a refcount in pool_stats
handling is more complex than I would have liked, but I think it is
worth if for the result seen in 4/5 of substantial simplification.

NeilBrown




^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCH 0/5 v2] sunrpc: stop refcounting svc_serv
@ 2023-12-15  0:56 NeilBrown
  2023-12-15  0:56 ` [PATCH 2/5] svc: don't hold reference for poolstats, only mutex NeilBrown
  0 siblings, 1 reply; 22+ messages in thread
From: NeilBrown @ 2023-12-15  0:56 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton
  Cc: linux-nfs, Olga Kornievskaia, Dai Ngo, Tom Talpey

I sent an earlier version of this series, got some feed back, revised
it, but never sent it again.  Sorry.

The main feedback was around the interaction between sunrpc and nfsd for
handling poolstats.  I have changed that so that nfsd tells sunrpc where
the svc_serv pointer lives, and where to find a mutex to protect it.
sunrpc then taks the mutex and accesses the pointer - if not NULL.  I
think this is nicer than the version that pass around funciton pointers.

This series is against nfsd-next

Thanks,
NeilBrown


 [PATCH 1/5] nfsd: call nfsd_last_thread() before final nfsd_put()
 [PATCH 2/5] svc: don't hold reference for poolstats, only mutex.
 [PATCH 3/5] nfsd: hold nfsd_mutex across entire netlink operation
 [PATCH 4/5] SUNRPC: discard sv_refcnt, and svc_get/svc_put
 [PATCH 5/5] nfsd: rename nfsd_last_thread() to nfsd_destroy_serv()

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

end of thread, other threads:[~2023-12-15  1:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30  1:08 [PATCH 0/5] sunrpc: not refcounting svc_serv NeilBrown
2023-10-30  1:08 ` [PATCH 1/5] nfsd: call nfsd_last_thread() before final nfsd_put() NeilBrown
2023-10-30 13:15   ` Jeff Layton
2023-10-30 15:52     ` Chuck Lever
2023-10-30 16:41       ` Jeff Layton
2023-10-30  1:08 ` [PATCH 2/5] svc: don't hold reference for poolstats, only mutex NeilBrown
2023-10-30 13:01   ` Jeff Layton
2023-10-30 21:48     ` NeilBrown
2023-10-31 13:08       ` Jeff Layton
2023-10-30  1:08 ` [PATCH 3/5] nfsd: hold nfsd_mutex across entire netlink operation NeilBrown
2023-10-30 13:03   ` Jeff Layton
2023-10-30 13:27     ` Lorenzo Bianconi
2023-10-30  1:08 ` [PATCH 4/5] SUNRPC: discard sv_refcnt, and svc_get/svc_put NeilBrown
2023-10-30 13:15   ` Jeff Layton
2023-10-30  1:08 ` [PATCH 5/5] nfsd: rename nfsd_last_thread() to nfsd_destroy_serv() NeilBrown
2023-10-30 13:15   ` Jeff Layton
2023-10-31 15:39 ` [PATCH 0/5] sunrpc: not refcounting svc_serv Chuck Lever III
2023-10-31 20:40   ` NeilBrown
2023-10-31 20:42     ` Chuck Lever III
2023-10-31 20:46       ` NeilBrown
2023-10-31 20:50         ` Chuck Lever III
  -- strict thread matches above, loose matches on Subject: below --
2023-12-15  0:56 [PATCH 0/5 v2] sunrpc: stop " NeilBrown
2023-12-15  0:56 ` [PATCH 2/5] svc: don't hold reference for poolstats, only mutex NeilBrown

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