Skip to contentSkip to conversation

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

PATCH New Jeff Layton 1 participant 1 message Mar 1, 2023

Subsystems (2)
lore
Share & tools
lore

Jeff Layton

author maintainer
#0 lore raw

PATCH 1/1 lockd: purge resources held on behalf of nlm clients when shutting down

From: Jeffrey Layton <[email protected]>

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.

---
 fs/lockd/host.c | 1 +
 1 file changed, 1 insertion(+)
fs/lockd/host.c +1 -0
index cdc8e12cdac4..127a728fcbc8 100644
@@ -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 */
Signature · 1 line
2.39.2