提交 fc40724f 编写于 作者: T Trond Myklebust

NFSv4: Revert commit 5f83d86c ("NFSv4.x: Fix wraparound issues..")

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: 5f83d86c ("NFSv4.x: Fix wraparound issues when validing...")
Cc: stable@vger.kernel.org # 4.6+
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
上级 ce5624f7
...@@ -428,11 +428,8 @@ validate_seqid(const struct nfs4_slot_table *tbl, const struct nfs4_slot *slot, ...@@ -428,11 +428,8 @@ validate_seqid(const struct nfs4_slot_table *tbl, const struct nfs4_slot *slot,
return htonl(NFS4ERR_SEQ_FALSE_RETRY); return htonl(NFS4ERR_SEQ_FALSE_RETRY);
} }
/* Wraparound */ /* Note: wraparound relies on seq_nr being of type u32 */
if (unlikely(slot->seq_nr == 0xFFFFFFFFU)) { if (likely(args->csa_sequenceid == slot->seq_nr + 1))
if (args->csa_sequenceid == 1)
return htonl(NFS4_OK);
} else if (likely(args->csa_sequenceid == slot->seq_nr + 1))
return htonl(NFS4_OK); return htonl(NFS4_OK);
/* Misordered request */ /* Misordered request */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册