aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-02-13 16:13:41 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-02-13 16:15:18 -0500
commitf6d82485e9a947ae19bb29e72644f4c6f27d5b89 (patch)
tree9bb1482584904710aab722b6c9b2b5e5b49780eb /fs/nfsd/nfs4state.c
parent508f92275624fc755104b17945bdc822936f1918 (diff)
nfsd4: fix sessions slotid wraparound logic
From RFC 5661 2.10.6.1: "If the previous sequence ID was 0xFFFFFFFF, then the next request for the slot MUST have the sequence ID set to zero." While we're there, delete some redundant comments. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index e8c98f009670..2095dbb2923e 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1575,16 +1575,11 @@ check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
1575 else 1575 else
1576 return nfserr_seq_misordered; 1576 return nfserr_seq_misordered;
1577 } 1577 }
1578 /* Normal */ 1578 /* Note unsigned 32-bit arithmetic handles wraparound: */
1579 if (likely(seqid == slot_seqid + 1)) 1579 if (likely(seqid == slot_seqid + 1))
1580 return nfs_ok; 1580 return nfs_ok;
1581 /* Replay */
1582 if (seqid == slot_seqid) 1581 if (seqid == slot_seqid)
1583 return nfserr_replay_cache; 1582 return nfserr_replay_cache;
1584 /* Wraparound */
1585 if (seqid == 1 && (slot_seqid + 1) == 0)
1586 return nfs_ok;
1587 /* Misordered replay or misordered new request */
1588 return nfserr_seq_misordered; 1583 return nfserr_seq_misordered;
1589} 1584}
1590 1585