DORMANTno replies

[PATCH] lockd: purge resources held on behalf of nlm clients when shutting down

From: Jeff Layton <jlayton@kernel.org>
Date: 2023-03-01 12:46:30
Subsystem: filesystems (vfs and infrastructure), kernel nfsd, sunrpc, and lockd servers, nfs, sunrpc, and lockd clients, the rest · Maintainers: Alexander Viro, Christian Brauner, Chuck Lever, Jeff Layton, Trond Myklebust, Anna Schumaker, Linus Torvalds

From: Jeffrey Layton <redacted>

It's easily possible for the server to have an outstanding lock when we
go to shut down. When that happens, we often get a warning like this in
the kernel log:

    lockd: couldn't shutdown host module for net f0000000!

This is because the shutdown procedures skip removing any hosts that
still have outstanding resources (locks). Eventually, things seem to get
cleaned up anyway, but the log message is unsettling, and server
shutdown doesn't seem to be working the way it was intended.

Ensure that we tear down any resources held on behalf of a client when
tearing one down for server shutdown.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2063818
Reported-by: Yongcheng Yang <redacted>
Signed-off-by: Jeffrey Layton <redacted>
---
 fs/lockd/host.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index cdc8e12cdac4..127a728fcbc8 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -629,6 +629,7 @@ nlm_shutdown_hosts_net(struct net *net)
 			rpc_shutdown_client(host->h_rpcclnt);
 			host->h_rpcclnt = NULL;
 		}
+		nlmsvc_free_host_resources(host);
 	}
 
 	/* Then, perform a garbage collection pass */
-- 
2.39.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help