summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2018-06-09 12:43:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-03 11:27:08 +0200
commit5819c04fb70862a0a72111d95e0204f37cf5ecc0 (patch)
treecde86d500c243e8aa4c2da375431c3aa6767a466 /fs/nfs
parent4c530c3b34fb53ab7293f04cb2b36f7ebb04e127 (diff)
downloadlinux-stable-5819c04fb70862a0a72111d95e0204f37cf5ecc0.tar.gz
linux-stable-5819c04fb70862a0a72111d95e0204f37cf5ecc0.tar.bz2
linux-stable-5819c04fb70862a0a72111d95e0204f37cf5ecc0.zip
NFSv4: Revert commit 5f83d86cf531d ("NFSv4.x: Fix wraparound issues..")
commit fc40724fc6731d90cc7fb6d62d66135f85a33dd2 upstream. 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: 5f83d86cf531d ("NFSv4.x: Fix wraparound issues when validing...") Cc: stable@vger.kernel.org # 4.6+ Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/callback_proc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index a50d7813e3ea..180b4b616725 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -420,11 +420,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 */