nfsd41: change check_slot_seqid parameters
For separation of session slot and clientid slot processing. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
This commit is contained in:
parent
5261dcf8eb
commit
88e588d56a
|
@ -1309,26 +1309,26 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
check_slot_seqid(u32 seqid, struct nfsd4_slot *slot)
|
check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
|
||||||
{
|
{
|
||||||
dprintk("%s enter. seqid %d slot->sl_seqid %d\n", __func__, seqid,
|
dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid,
|
||||||
slot->sl_seqid);
|
slot_seqid);
|
||||||
|
|
||||||
/* The slot is in use, and no response has been sent. */
|
/* The slot is in use, and no response has been sent. */
|
||||||
if (slot->sl_inuse) {
|
if (slot_inuse) {
|
||||||
if (seqid == slot->sl_seqid)
|
if (seqid == slot_seqid)
|
||||||
return nfserr_jukebox;
|
return nfserr_jukebox;
|
||||||
else
|
else
|
||||||
return nfserr_seq_misordered;
|
return nfserr_seq_misordered;
|
||||||
}
|
}
|
||||||
/* Normal */
|
/* Normal */
|
||||||
if (likely(seqid == slot->sl_seqid + 1))
|
if (likely(seqid == slot_seqid + 1))
|
||||||
return nfs_ok;
|
return nfs_ok;
|
||||||
/* Replay */
|
/* Replay */
|
||||||
if (seqid == slot->sl_seqid)
|
if (seqid == slot_seqid)
|
||||||
return nfserr_replay_cache;
|
return nfserr_replay_cache;
|
||||||
/* Wraparound */
|
/* Wraparound */
|
||||||
if (seqid == 1 && (slot->sl_seqid + 1) == 0)
|
if (seqid == 1 && (slot_seqid + 1) == 0)
|
||||||
return nfs_ok;
|
return nfs_ok;
|
||||||
/* Misordered replay or misordered new request */
|
/* Misordered replay or misordered new request */
|
||||||
return nfserr_seq_misordered;
|
return nfserr_seq_misordered;
|
||||||
|
@ -1351,7 +1351,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
|
||||||
|
|
||||||
if (conf) {
|
if (conf) {
|
||||||
slot = &conf->cl_slot;
|
slot = &conf->cl_slot;
|
||||||
status = check_slot_seqid(cr_ses->seqid, slot);
|
status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
|
||||||
|
slot->sl_inuse);
|
||||||
if (status == nfserr_replay_cache) {
|
if (status == nfserr_replay_cache) {
|
||||||
dprintk("Got a create_session replay! seqid= %d\n",
|
dprintk("Got a create_session replay! seqid= %d\n",
|
||||||
slot->sl_seqid);
|
slot->sl_seqid);
|
||||||
|
@ -1376,7 +1377,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
|
||||||
}
|
}
|
||||||
|
|
||||||
slot = &unconf->cl_slot;
|
slot = &unconf->cl_slot;
|
||||||
status = check_slot_seqid(cr_ses->seqid, slot);
|
status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
|
||||||
|
slot->sl_inuse);
|
||||||
if (status) {
|
if (status) {
|
||||||
/* an unconfirmed replay returns misordered */
|
/* an unconfirmed replay returns misordered */
|
||||||
status = nfserr_seq_misordered;
|
status = nfserr_seq_misordered;
|
||||||
|
@ -1477,7 +1479,7 @@ nfsd4_sequence(struct svc_rqst *rqstp,
|
||||||
slot = &session->se_slots[seq->slotid];
|
slot = &session->se_slots[seq->slotid];
|
||||||
dprintk("%s: slotid %d\n", __func__, seq->slotid);
|
dprintk("%s: slotid %d\n", __func__, seq->slotid);
|
||||||
|
|
||||||
status = check_slot_seqid(seq->seqid, slot);
|
status = check_slot_seqid(seq->seqid, slot->sl_seqid, slot->sl_inuse);
|
||||||
if (status == nfserr_replay_cache) {
|
if (status == nfserr_replay_cache) {
|
||||||
cstate->slot = slot;
|
cstate->slot = slot;
|
||||||
cstate->session = session;
|
cstate->session = session;
|
||||||
|
|
Loading…
Reference in New Issue