Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfsd: eliminate special handling of NFS4ERR_SEQ_MISORDERED

On a SEQ_MISORDERED error, the current code will reattempt the call, but
set the slot sequence ID to 1. I can find no mention of this remedy in
the spec, and it seems potentially dangerous. It's possible that the
last call was sent with seqid 1, and doing this will cause a
retransmission of the reply.

Drop this special handling, and always treat SEQ_MISORDERED like
BADSLOT. Retry the call, but leak the slot so that it is no longer used.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Jeff Layton and committed by
Chuck Lever
4b54b85e 999595a6

+5 -9
+5 -9
fs/nfsd/nfs4callback.c
··· 1388 1388 goto requeue; 1389 1389 rpc_delay(task, 2 * HZ); 1390 1390 return false; 1391 + case -NFS4ERR_SEQ_MISORDERED: 1391 1392 case -NFS4ERR_BADSLOT: 1392 1393 /* 1393 - * BADSLOT means that the client and server are out of sync 1394 - * as to the backchannel parameters. Mark the backchannel faulty 1395 - * and restart the RPC, but leak the slot so no one uses it. 1394 + * A SEQ_MISORDERED or BADSLOT error means that the client and 1395 + * server are out of sync as to the backchannel parameters. Mark 1396 + * the backchannel faulty and restart the RPC, but leak the slot 1397 + * so that it's no longer used. 1396 1398 */ 1397 1399 nfsd4_mark_cb_fault(cb->cb_clp); 1398 1400 cb->cb_held_slot = -1; 1399 1401 goto retry_nowait; 1400 - case -NFS4ERR_SEQ_MISORDERED: 1401 - if (session->se_cb_seq_nr[cb->cb_held_slot] != 1) { 1402 - session->se_cb_seq_nr[cb->cb_held_slot] = 1; 1403 - goto retry_nowait; 1404 - } 1405 - break; 1406 1402 default: 1407 1403 nfsd4_mark_cb_fault(cb->cb_clp); 1408 1404 }