Skip to content

Commit

Permalink
nfsd4: Fix forced-expiry locking
Browse files Browse the repository at this point in the history
[ Upstream commit f7104cc ]

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 89c905b.

Fixes: 89c905b "nfsd: allow forced expiration of NFSv4 clients"
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
J. Bruce Fields authored and gregkh committed Sep 15, 2021
1 parent e1af5db commit 75b9d8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/nfsd/nfs4state.c
Expand Up @@ -2687,9 +2687,9 @@ static void force_expire_client(struct nfs4_client *clp)

trace_nfsd_clid_admin_expired(&clp->cl_clientid);

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);
Expand Down

0 comments on commit 75b9d8b

Please sign in to comment.