Commit b2f28bd7 authored by Andy Adamson's avatar Andy Adamson Committed by Trond Myklebust

nfs41: prepare for back channel drc

Make all cb_sequence arguments available to verify_seqid which will make
replay decisions.
Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e95e60da
...@@ -153,34 +153,34 @@ int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const n ...@@ -153,34 +153,34 @@ int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const n
* a single outstanding callback request at a time. * a single outstanding callback request at a time.
*/ */
static int static int
validate_seqid(struct nfs4_slot_table *tbl, u32 slotid, u32 seqid) validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args)
{ {
struct nfs4_slot *slot; struct nfs4_slot *slot;
dprintk("%s enter. slotid %d seqid %d\n", dprintk("%s enter. slotid %d seqid %d\n",
__func__, slotid, seqid); __func__, args->csa_slotid, args->csa_sequenceid);
if (slotid > NFS41_BC_MAX_CALLBACKS) if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS)
return htonl(NFS4ERR_BADSLOT); return htonl(NFS4ERR_BADSLOT);
slot = tbl->slots + slotid; slot = tbl->slots + args->csa_slotid;
dprintk("%s slot table seqid: %d\n", __func__, slot->seq_nr); dprintk("%s slot table seqid: %d\n", __func__, slot->seq_nr);
/* Normal */ /* Normal */
if (likely(seqid == slot->seq_nr + 1)) { if (likely(args->csa_sequenceid == slot->seq_nr + 1)) {
slot->seq_nr++; slot->seq_nr++;
return htonl(NFS4_OK); return htonl(NFS4_OK);
} }
/* Replay */ /* Replay */
if (seqid == slot->seq_nr) { if (args->csa_sequenceid == slot->seq_nr) {
dprintk("%s seqid %d is a replay - no DRC available\n", dprintk("%s seqid %d is a replay - no DRC available\n",
__func__, seqid); __func__, args->csa_sequenceid);
return htonl(NFS4_OK); return htonl(NFS4_OK);
} }
/* Wraparound */ /* Wraparound */
if (seqid == 1 && (slot->seq_nr + 1) == 0) { if (args->csa_sequenceid == 1 && (slot->seq_nr + 1) == 0) {
slot->seq_nr = 1; slot->seq_nr = 1;
return htonl(NFS4_OK); return htonl(NFS4_OK);
} }
...@@ -291,8 +291,7 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, ...@@ -291,8 +291,7 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
if (clp == NULL) if (clp == NULL)
goto out; goto out;
status = validate_seqid(&clp->cl_session->bc_slot_table, status = validate_seqid(&clp->cl_session->bc_slot_table, args);
args->csa_slotid, args->csa_sequenceid);
if (status) if (status)
goto out_putclient; goto out_putclient;
......
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