diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-07-30 08:27:03 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-08-01 16:28:18 -0400 |
commit | 4864af97e02d1ef6aa78963195a64ed2ed7752c3 (patch) | |
tree | c7c09fa544f353f4777826e0c2cc575758798f17 /fs/nfsd | |
parent | 4beb345b37fc099e98f40d20c94da6c07654005c (diff) |
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: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index cb630db015b0..a374592e7dcf 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4125,13 +4125,15 @@ nfs4_laundromat(struct nfsd_net *nn) | |||
4125 | clp->cl_clientid.cl_id); | 4125 | clp->cl_clientid.cl_id); |
4126 | continue; | 4126 | continue; |
4127 | } | 4127 | } |
4128 | list_move(&clp->cl_lru, &reaplist); | 4128 | unhash_client_locked(clp); |
4129 | list_add(&clp->cl_lru, &reaplist); | ||
4129 | } | 4130 | } |
4130 | spin_unlock(&nn->client_lock); | 4131 | spin_unlock(&nn->client_lock); |
4131 | list_for_each_safe(pos, next, &reaplist) { | 4132 | list_for_each_safe(pos, next, &reaplist) { |
4132 | clp = list_entry(pos, struct nfs4_client, cl_lru); | 4133 | clp = list_entry(pos, struct nfs4_client, cl_lru); |
4133 | dprintk("NFSD: purging unused client (clientid %08x)\n", | 4134 | dprintk("NFSD: purging unused client (clientid %08x)\n", |
4134 | clp->cl_clientid.cl_id); | 4135 | clp->cl_clientid.cl_id); |
4136 | list_del_init(&clp->cl_lru); | ||
4135 | expire_client(clp); | 4137 | expire_client(clp); |
4136 | } | 4138 | } |
4137 | spin_lock(&state_lock); | 4139 | spin_lock(&state_lock); |