diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2010-06-15 14:22:37 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-01-11 15:04:09 -0500 |
commit | 4c6493785a1ea9c3b3522f199760a90a30e1626c (patch) | |
tree | 30dd59c79e81cb59e77d7f270df755f061a0b8d5 /fs/nfsd/nfs4state.c | |
parent | ec26fba40fa92c7cc5c61d40746f499dcefc67be (diff) |
nfsd4: modify session list under cl_lock
We want to traverse this from the callback code.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index b583e4e800ab..3cf9900d5f32 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -771,7 +771,9 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n | |||
771 | idx = hash_sessionid(&new->se_sessionid); | 771 | idx = hash_sessionid(&new->se_sessionid); |
772 | spin_lock(&client_lock); | 772 | spin_lock(&client_lock); |
773 | list_add(&new->se_hash, &sessionid_hashtbl[idx]); | 773 | list_add(&new->se_hash, &sessionid_hashtbl[idx]); |
774 | spin_lock(&clp->cl_lock); | ||
774 | list_add(&new->se_perclnt, &clp->cl_sessions); | 775 | list_add(&new->se_perclnt, &clp->cl_sessions); |
776 | spin_unlock(&clp->cl_lock); | ||
775 | spin_unlock(&client_lock); | 777 | spin_unlock(&client_lock); |
776 | 778 | ||
777 | status = nfsd4_new_conn(rqstp, new); | 779 | status = nfsd4_new_conn(rqstp, new); |
@@ -819,7 +821,9 @@ static void | |||
819 | unhash_session(struct nfsd4_session *ses) | 821 | unhash_session(struct nfsd4_session *ses) |
820 | { | 822 | { |
821 | list_del(&ses->se_hash); | 823 | list_del(&ses->se_hash); |
824 | spin_lock(&ses->se_client->cl_lock); | ||
822 | list_del(&ses->se_perclnt); | 825 | list_del(&ses->se_perclnt); |
826 | spin_unlock(&ses->se_client->cl_lock); | ||
823 | } | 827 | } |
824 | 828 | ||
825 | /* must be called under the client_lock */ | 829 | /* must be called under the client_lock */ |
@@ -925,8 +929,10 @@ unhash_client_locked(struct nfs4_client *clp) | |||
925 | 929 | ||
926 | mark_client_expired(clp); | 930 | mark_client_expired(clp); |
927 | list_del(&clp->cl_lru); | 931 | list_del(&clp->cl_lru); |
932 | spin_lock(&clp->cl_lock); | ||
928 | list_for_each_entry(ses, &clp->cl_sessions, se_perclnt) | 933 | list_for_each_entry(ses, &clp->cl_sessions, se_perclnt) |
929 | list_del_init(&ses->se_hash); | 934 | list_del_init(&ses->se_hash); |
935 | spin_unlock(&clp->cl_lock); | ||
930 | } | 936 | } |
931 | 937 | ||
932 | static void | 938 | static void |