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

Commit aebe7e47 authored by Trond Myklebust's avatar Trond Myklebust Committed by Greg Kroah-Hartman
Browse files

NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT



[ Upstream commit 037e56a22ff37f9a9c2330b66cff55d3d1ff9b90 ]

Once the client has processed the CB_LAYOUTRECALL, but has not yet
successfully returned the layout, the server is supposed to switch to
returning NFS4ERR_RETURNCONFLICT. This patch ensures that we handle
that return value correctly.

Fixes: 183d9e7b ("pnfs: rework LAYOUTGET retry handling")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent db55dbbb
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -168,6 +168,7 @@ static int nfs4_map_errors(int err)
	case -NFS4ERR_RESOURCE:
	case -NFS4ERR_RESOURCE:
	case -NFS4ERR_LAYOUTTRYLATER:
	case -NFS4ERR_LAYOUTTRYLATER:
	case -NFS4ERR_RECALLCONFLICT:
	case -NFS4ERR_RECALLCONFLICT:
	case -NFS4ERR_RETURNCONFLICT:
		return -EREMOTEIO;
		return -EREMOTEIO;
	case -NFS4ERR_WRONGSEC:
	case -NFS4ERR_WRONGSEC:
	case -NFS4ERR_WRONG_CRED:
	case -NFS4ERR_WRONG_CRED:
@@ -552,6 +553,7 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
		case -NFS4ERR_GRACE:
		case -NFS4ERR_GRACE:
		case -NFS4ERR_LAYOUTTRYLATER:
		case -NFS4ERR_LAYOUTTRYLATER:
		case -NFS4ERR_RECALLCONFLICT:
		case -NFS4ERR_RECALLCONFLICT:
		case -NFS4ERR_RETURNCONFLICT:
			exception->delay = 1;
			exception->delay = 1;
			return 0;
			return 0;


@@ -9159,6 +9161,7 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
		status = -EBUSY;
		status = -EBUSY;
		break;
		break;
	case -NFS4ERR_RECALLCONFLICT:
	case -NFS4ERR_RECALLCONFLICT:
	case -NFS4ERR_RETURNCONFLICT:
		status = -ERECALLCONFLICT;
		status = -ERECALLCONFLICT;
		break;
		break;
	case -NFS4ERR_DELEG_REVOKED:
	case -NFS4ERR_DELEG_REVOKED: