Skip to content

Commit

Permalink
NFSv4: Revert commit 5f83d86 ("NFSv4.x: Fix wraparound issues..")
Browse files Browse the repository at this point in the history
The correct behaviour for NFSv4 sequence IDs is to wrap around
to the value 0 after 0xffffffff.
See https://tools.ietf.org/html/rfc5661#section-2.10.6.1

Fixes: 5f83d86 ("NFSv4.x: Fix wraparound issues when validing...")
Cc: [email protected] # 4.6+
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Trond Myklebust committed Jun 9, 2018
1 parent ce5624f commit fc40724
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/nfs/callback_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,8 @@ validate_seqid(const struct nfs4_slot_table *tbl, const struct nfs4_slot *slot,
return htonl(NFS4ERR_SEQ_FALSE_RETRY);
}

/* Wraparound */
if (unlikely(slot->seq_nr == 0xFFFFFFFFU)) {
if (args->csa_sequenceid == 1)
return htonl(NFS4_OK);
} else if (likely(args->csa_sequenceid == slot->seq_nr + 1))
/* Note: wraparound relies on seq_nr being of type u32 */
if (likely(args->csa_sequenceid == slot->seq_nr + 1))
return htonl(NFS4_OK);

/* Misordered request */
Expand Down

0 comments on commit fc40724

Please sign in to comment.