Commit a4dff1bc492ee4a2184d384ae8b5bcab5859e150
Committed by
Trond Myklebust
1 parent
5794d21ef4
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
SUNRPC: skip dead but not buried clients on PipeFS events
These clients can't be safely dereferenced if their counter in 0. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
net/sunrpc/clnt.c
... | ... | @@ -218,7 +218,8 @@ |
218 | 218 | if (((event == RPC_PIPEFS_MOUNT) && clnt->cl_dentry) || |
219 | 219 | ((event == RPC_PIPEFS_UMOUNT) && !clnt->cl_dentry)) |
220 | 220 | continue; |
221 | - atomic_inc(&clnt->cl_count); | |
221 | + if (atomic_inc_not_zero(&clnt->cl_count) == 0) | |
222 | + continue; | |
222 | 223 | spin_unlock(&sn->rpc_client_lock); |
223 | 224 | return clnt; |
224 | 225 | } |