Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8794440 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4.1: Try to deal with NFS4ERR_SEQ_MISORDERED.



If the server returns NFS4ERR_SEQ_MISORDERED, it could be a sign
that the slot was retired at some point. Retry the attempt after
reinitialising the slot sequence number to 1.

Also add a handler for NFS4ERR_SEQ_FALSE_RETRY. Just bump the slot
sequence number and retry...

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 65a0c149
Loading
Loading
Loading
Loading
+19 −5
Original line number Original line Diff line number Diff line
@@ -467,11 +467,19 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
		 * The slot id we used was probably retired. Try again
		 * The slot id we used was probably retired. Try again
		 * using a different slot id.
		 * using a different slot id.
		 */
		 */
		if (rpc_restart_call_prepare(task)) {
		goto retry_nowait;
			task->tk_status = 0;
	case -NFS4ERR_SEQ_MISORDERED:
			ret = 0;
		/*
		}
		 * Could this slot have been previously retired?
		 * If so, then the server may be expecting seq_nr = 1!
		 */
		if (slot->seq_nr == 1)
			break;
			break;
		slot->seq_nr = 1;
		goto retry_nowait;
	case -NFS4ERR_SEQ_FALSE_RETRY:
		++slot->seq_nr;
		goto retry_nowait;
	default:
	default:
		/* Just update the slot sequence no. */
		/* Just update the slot sequence no. */
		++slot->seq_nr;
		++slot->seq_nr;
@@ -481,6 +489,12 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
	dprintk("%s: Error %d free the slot \n", __func__, res->sr_status);
	dprintk("%s: Error %d free the slot \n", __func__, res->sr_status);
	nfs41_sequence_free_slot(res);
	nfs41_sequence_free_slot(res);
	return ret;
	return ret;
retry_nowait:
	if (rpc_restart_call_prepare(task)) {
		task->tk_status = 0;
		ret = 0;
	}
	goto out;
out_retry:
out_retry:
	if (!rpc_restart_call(task))
	if (!rpc_restart_call(task))
		goto out;
		goto out;