All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFSv4.1: RECLAIM_COMPLETE must handle EACCES
@ 2022-07-27 10:01 Yi Wang
  2022-08-09  3:10 ` wang.yi59
  0 siblings, 1 reply; 2+ messages in thread
From: Yi Wang @ 2022-07-27 10:01 UTC (permalink / raw)
  To: trond.myklebust
  Cc: anna, linux-nfs, linux-kernel, xue.zhihong, wang.yi59,
	wang.liang82, Zhang Xianwei

From: Zhang Xianwei <zhang.xianwei8@zte.com.cn>

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.

Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 fs/nfs/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index bb0e84a46d61..b51b83506011 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -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:
-- 
2.18.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re:[PATCH] NFSv4.1: RECLAIM_COMPLETE must handle EACCES
  2022-07-27 10:01 [PATCH] NFSv4.1: RECLAIM_COMPLETE must handle EACCES Yi Wang
@ 2022-08-09  3:10 ` wang.yi59
  0 siblings, 0 replies; 2+ messages in thread
From: wang.yi59 @ 2022-08-09  3:10 UTC (permalink / raw)
  To: trond.myklebust, anna, linux-nfs
  Cc: linux-kernel, xue.zhihong, wang.liang82, zhang.xianwei8, wang.yi59

Gentle ping :)

> From: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
>
> 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.
>
> Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> ---
> fs/nfs/nfs4proc.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index bb0e84a46d61..b51b83506011 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -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:

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-09  3:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27 10:01 [PATCH] NFSv4.1: RECLAIM_COMPLETE must handle EACCES Yi Wang
2022-08-09  3:10 ` wang.yi59

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.