diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-20 20:24:02 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-05 18:30:41 -0500 |
commit | d5fb4ce33e26e4c1c31c1609b8ffbb24f80bcab8 (patch) | |
tree | 3b6335ba79258c540be8a21d1ffce412b6d95d52 /fs/nfs | |
parent | ce008c4bb9766bc7eeb02e8299c8baadc25da90b (diff) |
NFSv4.1: Don't confuse target_highest_slotid and max_slots in cb_recall_slot
Don't confuse the table size and the target_highest_slotid...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/callback.h | 2 | ||||
-rw-r--r-- | fs/nfs/callback_proc.c | 12 | ||||
-rw-r--r-- | fs/nfs/callback_xdr.c | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h index 4251c2ae06ad..e75631e264f4 100644 --- a/fs/nfs/callback.h +++ b/fs/nfs/callback.h | |||
@@ -142,7 +142,7 @@ extern __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, | |||
142 | 142 | ||
143 | struct cb_recallslotargs { | 143 | struct cb_recallslotargs { |
144 | struct sockaddr *crsa_addr; | 144 | struct sockaddr *crsa_addr; |
145 | uint32_t crsa_target_max_slots; | 145 | uint32_t crsa_target_highest_slotid; |
146 | }; | 146 | }; |
147 | extern __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, | 147 | extern __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, |
148 | void *dummy, | 148 | void *dummy, |
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 15b9879d6fbb..ed0b446e2e38 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -561,22 +561,20 @@ __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, void *dummy, | |||
561 | if (!cps->clp) /* set in cb_sequence */ | 561 | if (!cps->clp) /* set in cb_sequence */ |
562 | goto out; | 562 | goto out; |
563 | 563 | ||
564 | dprintk_rcu("NFS: CB_RECALL_SLOT request from %s target max slots %d\n", | 564 | dprintk_rcu("NFS: CB_RECALL_SLOT request from %s target highest slotid %d\n", |
565 | rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR), | 565 | rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR), |
566 | args->crsa_target_max_slots); | 566 | args->crsa_target_highest_slotid); |
567 | 567 | ||
568 | fc_tbl = &cps->clp->cl_session->fc_slot_table; | 568 | fc_tbl = &cps->clp->cl_session->fc_slot_table; |
569 | 569 | ||
570 | status = htonl(NFS4ERR_BAD_HIGH_SLOT); | 570 | status = htonl(NFS4ERR_BAD_HIGH_SLOT); |
571 | if (args->crsa_target_max_slots > fc_tbl->max_slots || | 571 | if (args->crsa_target_highest_slotid >= fc_tbl->max_slots || |
572 | args->crsa_target_max_slots < 1) | 572 | args->crsa_target_highest_slotid < 1) |
573 | goto out; | 573 | goto out; |
574 | 574 | ||
575 | status = htonl(NFS4_OK); | 575 | status = htonl(NFS4_OK); |
576 | if (args->crsa_target_max_slots == fc_tbl->max_slots) | ||
577 | goto out; | ||
578 | 576 | ||
579 | nfs41_set_target_slotid(fc_tbl, args->crsa_target_max_slots); | 577 | nfs41_set_target_slotid(fc_tbl, args->crsa_target_highest_slotid); |
580 | nfs41_handle_recall_slot(cps->clp); | 578 | nfs41_handle_recall_slot(cps->clp); |
581 | out: | 579 | out: |
582 | dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); | 580 | dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); |
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 742ff4ffced7..81e8c7d4c2e8 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c | |||
@@ -520,7 +520,7 @@ static __be32 decode_recallslot_args(struct svc_rqst *rqstp, | |||
520 | p = read_buf(xdr, 4); | 520 | p = read_buf(xdr, 4); |
521 | if (unlikely(p == NULL)) | 521 | if (unlikely(p == NULL)) |
522 | return htonl(NFS4ERR_BADXDR); | 522 | return htonl(NFS4ERR_BADXDR); |
523 | args->crsa_target_max_slots = ntohl(*p++); | 523 | args->crsa_target_highest_slotid = ntohl(*p++); |
524 | return 0; | 524 | return 0; |
525 | } | 525 | } |
526 | 526 | ||