]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4.1: Avoid false retries when RPC calls are interrupted
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 20 Jun 2018 21:53:34 +0000 (17:53 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 21 Feb 2019 18:22:43 +0000 (13:22 -0500)
commit5d49345bf7a6123c463109058e907617ded2e431
tree54f690ed32d37f631561238542b211e955f1713d
parentd1e3f756314e0d823449efd2db3f22b972b049ac
NFSv4.1: Avoid false retries when RPC calls are interrupted

A 'false retry' in NFSv4.1 occurs when the client attempts to transmit a
new RPC call using a slot+sequence number combination that references an
already cached one. Currently, the Linux NFS client will do this if a
user process interrupts an RPC call that is in progress.
The problem with doing so is that we defeat the main mechanism used by
the server to differentiate between a new call and a replayed one. Even
if the server is able to perfectly cache the arguments of the old call,
it cannot know if the client intended to replay or send a new call.

The obvious fix is to bump the sequence number pre-emptively if an
RPC call is interrupted, but in order to deal with the corner cases
where the interrupted call is not actually received and processed by
the server, we need to interpret the error NFS4ERR_SEQ_MISORDERED
as a sign that we need to either wait or locate a correct sequence
number that lies between the value we sent, and the last value that
was acked by a SEQUENCE call on that slot.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Jason Tibbitts <tibbs@math.uh.edu>
fs/nfs/nfs4proc.c
fs/nfs/nfs4session.c
fs/nfs/nfs4session.h