aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index d5d070fbeb35..3ba65979a3cd 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1538,7 +1538,7 @@ out_err:
1538} 1538}
1539 1539
1540/* 1540/*
1541 * Cache a reply. nfsd4_check_drc_limit() has bounded the cache size. 1541 * Cache a reply. nfsd4_check_resp_size() has bounded the cache size.
1542 */ 1542 */
1543void 1543void
1544nfsd4_store_cache_entry(struct nfsd4_compoundres *resp) 1544nfsd4_store_cache_entry(struct nfsd4_compoundres *resp)
@@ -1596,7 +1596,7 @@ nfsd4_enc_sequence_replay(struct nfsd4_compoundargs *args,
1596 * The sequence operation is not cached because we can use the slot and 1596 * The sequence operation is not cached because we can use the slot and
1597 * session values. 1597 * session values.
1598 */ 1598 */
1599__be32 1599static __be32
1600nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp, 1600nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp,
1601 struct nfsd4_sequence *seq) 1601 struct nfsd4_sequence *seq)
1602{ 1602{
@@ -1605,9 +1605,8 @@ nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp,
1605 1605
1606 dprintk("--> %s slot %p\n", __func__, slot); 1606 dprintk("--> %s slot %p\n", __func__, slot);
1607 1607
1608 /* Either returns 0 or nfserr_retry_uncached */
1609 status = nfsd4_enc_sequence_replay(resp->rqstp->rq_argp, resp); 1608 status = nfsd4_enc_sequence_replay(resp->rqstp->rq_argp, resp);
1610 if (status == nfserr_retry_uncached_rep) 1609 if (status)
1611 return status; 1610 return status;
1612 1611
1613 /* The sequence operation has been encoded, cstate->datap set. */ 1612 /* The sequence operation has been encoded, cstate->datap set. */
@@ -2287,7 +2286,8 @@ out:
2287 if (!list_empty(&clp->cl_revoked)) 2286 if (!list_empty(&clp->cl_revoked))
2288 seq->status_flags |= SEQ4_STATUS_RECALLABLE_STATE_REVOKED; 2287 seq->status_flags |= SEQ4_STATUS_RECALLABLE_STATE_REVOKED;
2289out_no_session: 2288out_no_session:
2290 kfree(conn); 2289 if (conn)
2290 free_conn(conn);
2291 spin_unlock(&nn->client_lock); 2291 spin_unlock(&nn->client_lock);
2292 return status; 2292 return status;
2293out_put_session: 2293out_put_session:
@@ -3627,8 +3627,11 @@ static __be32 nfsd4_lookup_stateid(stateid_t *stateid, unsigned char typemask,
3627 return nfserr_bad_stateid; 3627 return nfserr_bad_stateid;
3628 status = lookup_clientid(&stateid->si_opaque.so_clid, sessions, 3628 status = lookup_clientid(&stateid->si_opaque.so_clid, sessions,
3629 nn, &cl); 3629 nn, &cl);
3630 if (status == nfserr_stale_clientid) 3630 if (status == nfserr_stale_clientid) {
3631 if (sessions)
3632 return nfserr_bad_stateid;
3631 return nfserr_stale_stateid; 3633 return nfserr_stale_stateid;
3634 }
3632 if (status) 3635 if (status)
3633 return status; 3636 return status;
3634 *s = find_stateid_by_type(cl, stateid, typemask); 3637 *s = find_stateid_by_type(cl, stateid, typemask);
@@ -5062,7 +5065,6 @@ nfs4_state_destroy_net(struct net *net)
5062 int i; 5065 int i;
5063 struct nfs4_client *clp = NULL; 5066 struct nfs4_client *clp = NULL;
5064 struct nfsd_net *nn = net_generic(net, nfsd_net_id); 5067 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
5065 struct rb_node *node, *tmp;
5066 5068
5067 for (i = 0; i < CLIENT_HASH_SIZE; i++) { 5069 for (i = 0; i < CLIENT_HASH_SIZE; i++) {
5068 while (!list_empty(&nn->conf_id_hashtbl[i])) { 5070 while (!list_empty(&nn->conf_id_hashtbl[i])) {
@@ -5071,13 +5073,11 @@ nfs4_state_destroy_net(struct net *net)
5071 } 5073 }
5072 } 5074 }
5073 5075
5074 node = rb_first(&nn->unconf_name_tree); 5076 for (i = 0; i < CLIENT_HASH_SIZE; i++) {
5075 while (node != NULL) { 5077 while (!list_empty(&nn->unconf_id_hashtbl[i])) {
5076 tmp = node; 5078 clp = list_entry(nn->unconf_id_hashtbl[i].next, struct nfs4_client, cl_idhash);
5077 node = rb_next(tmp); 5079 destroy_client(clp);
5078 clp = rb_entry(tmp, struct nfs4_client, cl_namenode); 5080 }
5079 rb_erase(tmp, &nn->unconf_name_tree);
5080 destroy_client(clp);
5081 } 5081 }
5082 5082
5083 kfree(nn->sessionid_hashtbl); 5083 kfree(nn->sessionid_hashtbl);