Skip to contentSkip to conversation

NFSv4.1: RECLAIM_COMPLETE must handle EACCES

PATCH In review Yi Wang 1 participant 2 messages Jul 27, 2022 – Aug 9, 2022

Subsystems (2)
lore
Share & tools
lore

Yi Wang

author
#0 lore raw

PATCH 1/1 NFSv4.1: RECLAIM_COMPLETE must handle EACCES

From: Zhang Xianwei <[email protected]>

A client should be able to handle getting an EACCES error while doing a mount operation to reclaim state due to NFS4CLNT_RECLAIM_REBOOT being set. If the server returns RPC_AUTH_BADCRED because authentication failed when we execute "exportfs -au", then RECLAIM_COMPLETE will go a wrong way. After mount succeeds, all OPEN call will fail due to an NFS4ERR_GRACE error being returned. This patch is to fix it by resending a RPC request.

---
 fs/nfs/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)
fs/nfs/nfs4proc.c +3 -0
index bb0e84a46d61..b51b83506011 100644
@@ -9477,6 +9477,9 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf
 		rpc_delay(task, NFS4_POLL_RETRY_MAX);
 		fallthrough;
 	case -NFS4ERR_RETRY_UNCACHED_REP:
+	case -EACCES:
+		dprintk("%s: failed to reclaim complete error %d for server %s, retrying\n",
+			__func__, task->tk_status, clp->cl_hostname);
 		return -EAGAIN;
 	case -NFS4ERR_BADSESSION:
 	case -NFS4ERR_DEADSESSION:
Signature · 1 line
2.18.4
#1 lore raw

Gentle ping :)

Quoted 30 lines

From: Zhang Xianwei <[email protected]>

A client should be able to handle getting an EACCES error while doing a mount operation to reclaim state due to NFS4CLNT_RECLAIM_REBOOT being set. If the server returns RPC_AUTH_BADCRED because authentication failed when we execute "exportfs -au", then RECLAIM_COMPLETE will go a wrong way. After mount succeeds, all OPEN call will fail due to an NFS4ERR_GRACE error being returned. This patch is to fix it by resending a RPC request.

---
fs/nfs/nfs4proc.c | 3 +++

1 file changed, 3 insertions(+)
fs/nfs/nfs4proc.c +0 -0
index bb0e84a46d61..b51b83506011 100644
@@ -9477,6 +9477,9 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf
 rpc_delay(task, NFS4_POLL_RETRY_MAX);
 fallthrough;

case -NFS4ERR_RETRY_UNCACHED_REP:
+ case -EACCES:
+ dprintk("%s: failed to reclaim complete error %d for server %s, retrying\n",
+ __func__, task->tk_status, clp->cl_hostname);
return -EAGAIN;
case -NFS4ERR_BADSESSION:
case -NFS4ERR_DEADSESSION: