NFSv4.1: Fix up replays of interrupted requests
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 19 Oct 2017 19:46:45 +0000 (15:46 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jun 2018 00:06:29 +0000 (08:06 +0800)
commit84f4d2c6dabef6622f4d22a592cf4d1dca9e7dae
treeb18e904d7a871e0a4775214a8c6f1e95371cd260
parent5e8a5c30546f731b20591eb8cffc7db299286d05
NFSv4.1: Fix up replays of interrupted requests

commit 3be0f80b5fe9c16eca2d538f799b94ca8aa59433 upstream.

If the previous request on a slot was interrupted before it was
processed by the server, then our slot sequence number may be out of whack,
and so we try the next operation using the old sequence number.

The problem with this, is that not all servers check to see that the
client is replaying the same operations as previously when they decide
to go to the replay cache, and so instead of the expected error of
NFS4ERR_SEQ_FALSE_RETRY, we get a replay of the old reply, which could
(if the operations match up) be mistaken by the client for a new reply.

To fix this, we attempt to send a COMPOUND containing only the SEQUENCE op
in order to resync our slot sequence number.

Cc: Olga Kornievskaia <olga.kornievskaia@gmail.com>
[olga.kornievskaia@gmail.com: fix an Oops]
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4_fs.h
fs/nfs/nfs4proc.c