Commit 4864af97 authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields

nfsd: Ensure that the laundromat unhashes the client before releasing locks

If we leave the client on the confirmed/unconfirmed tables, and leave
the sessions visible on the sessionid_hashtbl, then someone might
find them before we've had a chance to destroy them.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 4beb345b
...@@ -4125,13 +4125,15 @@ nfs4_laundromat(struct nfsd_net *nn) ...@@ -4125,13 +4125,15 @@ nfs4_laundromat(struct nfsd_net *nn)
clp->cl_clientid.cl_id); clp->cl_clientid.cl_id);
continue; continue;
} }
list_move(&clp->cl_lru, &reaplist); unhash_client_locked(clp);
list_add(&clp->cl_lru, &reaplist);
} }
spin_unlock(&nn->client_lock); spin_unlock(&nn->client_lock);
list_for_each_safe(pos, next, &reaplist) { list_for_each_safe(pos, next, &reaplist) {
clp = list_entry(pos, struct nfs4_client, cl_lru); clp = list_entry(pos, struct nfs4_client, cl_lru);
dprintk("NFSD: purging unused client (clientid %08x)\n", dprintk("NFSD: purging unused client (clientid %08x)\n",
clp->cl_clientid.cl_id); clp->cl_clientid.cl_id);
list_del_init(&clp->cl_lru);
expire_client(clp); expire_client(clp);
} }
spin_lock(&state_lock); spin_lock(&state_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment