All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] SUNRPC: wake a thread after re-queueing transports in svc_clean_up_xprts()
@ 2026-10-05 13:42 Benjamin Coddington
  2026-10-05 15:08 ` Chuck Lever
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Coddington @ 2026-10-05 13:42 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton, NeilBrown; +Cc: linux-nfs

From: Benjamin Coddington <bcodding@hammerspace.com>

svc_clean_up_xprts() takes every ready transport off the pool's queue,
deletes those belonging to the network namespace being shut down, and
puts the rest back with lwq_enqueue_batch().  No thread is woken.  A
thread that tested the queue while it was drained has gone to sleep,
and the re-queued transports still carry XPT_BUSY, so the data they
receive next cannot enqueue them either.  They wait until an unrelated
transport wakes a thread.  lockd and the NFSv4 callback service share
one service across network namespaces and wait in svc_recv() without a
timeout, so nothing bounds that wait.

Reproduced with lockd: with NLM traffic running in the initial
network namespace, mounting and unmounting NFSv3 in a second
namespace takes lockd down there, and lock requests in the first
namespace stop being answered until something else wakes the
lockd thread.

Wake a thread after putting the transports back.

Fixes: 9a0e6accc0a8 ("SUNRPC: use lwq for sp_sockets - renamed to sp_xprts")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/cover.1782314746.git.bcodding@hammerspace.com?part=2
Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
---
Changes in v2:
 - wake a thread whenever transports are put back, not only when the
   queue was empty (Chuck)
 - description: drop nfsd, its service is per-net and has nothing to
   put back (Chuck)
 - sent with an in-body From so the author matches the Signed-off-by
 v1: https://lore.kernel.org/linux-nfs/5b162e1a03d59bd0d3cc479891965834d0d4f0c8.1790948398.git.bcodding@hammerspace.com/

 net/sunrpc/svc_xprt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 0de613b36fff..288d442f47c3 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -1246,8 +1246,10 @@ static void svc_clean_up_xprts(struct svc_serv *serv, struct net *net)
 			}
 		}
 
-		if (q)
+		if (q) {
 			lwq_enqueue_batch(q, &pool->sp_xprts);
+			svc_pool_wake_idle_thread(pool);
+		}
 	}
 }
 
-- 
2.53.0


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

end of thread, other threads:[~2026-10-05 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-05 13:42 [PATCH v2] SUNRPC: wake a thread after re-queueing transports in svc_clean_up_xprts() Benjamin Coddington
2026-10-05 15:08 ` Chuck Lever

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.