Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb3c6a25 authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Greg Kroah-Hartman
Browse files

nfsd4: Fix forced-expiry locking



[ Upstream commit f7104cc1a9159cd0d3e8526cb638ae0301de4b61 ]

This should use the network-namespace-wide client_lock, not the
per-client cl_lock.

You shouldn't see any bugs unless you're actually using the
forced-expiry interface introduced by 89c905be.

Fixes: 89c905be "nfsd: allow forced expiration of NFSv4 clients"
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 81e69d3f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2572,9 +2572,9 @@ static void force_expire_client(struct nfs4_client *clp)
	struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id);
	bool already_expired;

	spin_lock(&clp->cl_lock);
	spin_lock(&nn->client_lock);
	clp->cl_time = 0;
	spin_unlock(&clp->cl_lock);
	spin_unlock(&nn->client_lock);

	wait_event(expiry_wq, atomic_read(&clp->cl_rpc_users) == 0);
	spin_lock(&nn->client_lock);