Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164598
b: refs/heads/master
c: 88e588d
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and J. Bruce Fields committed Jul 28, 2009
1 parent cf527e4 commit fe9cd09
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5261dcf8eb3d098545a676030910cf2c05a00e6c
refs/heads/master: 88e588d56a2f0226a34386b94a03fda97d2b8e67
24 changes: 13 additions & 11 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,26 +1309,26 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
}

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,
slot->sl_seqid);
dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid,
slot_seqid);

/* The slot is in use, and no response has been sent. */
if (slot->sl_inuse) {
if (seqid == slot->sl_seqid)
if (slot_inuse) {
if (seqid == slot_seqid)
return nfserr_jukebox;
else
return nfserr_seq_misordered;
}
/* Normal */
if (likely(seqid == slot->sl_seqid + 1))
if (likely(seqid == slot_seqid + 1))
return nfs_ok;
/* Replay */
if (seqid == slot->sl_seqid)
if (seqid == slot_seqid)
return nfserr_replay_cache;
/* Wraparound */
if (seqid == 1 && (slot->sl_seqid + 1) == 0)
if (seqid == 1 && (slot_seqid + 1) == 0)
return nfs_ok;
/* Misordered replay or misordered new request */
return nfserr_seq_misordered;
Expand All @@ -1351,7 +1351,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,

if (conf) {
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) {
dprintk("Got a create_session replay! seqid= %d\n",
slot->sl_seqid);
Expand All @@ -1376,7 +1377,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
}

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) {
/* an unconfirmed replay returns misordered */
status = nfserr_seq_misordered;
Expand Down Expand Up @@ -1477,7 +1479,7 @@ nfsd4_sequence(struct svc_rqst *rqstp,
slot = &session->se_slots[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) {
cstate->slot = slot;
cstate->session = session;
Expand Down

0 comments on commit fe9cd09

Please sign in to comment.