All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION
@ 2017-05-04 19:41 Trond Myklebust
  2017-05-05 15:59 ` Chuck Lever
  0 siblings, 1 reply; 2+ messages in thread
From: Trond Myklebust @ 2017-05-04 19:41 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs

If the server returns NFS4ERR_CONN_NOT_BOUND_TO_SESSION because we
are trunking, then RECLAIM_COMPLETE must handle that by calling
nfs4_schedule_session_recovery() and then retrying.

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/nfs4proc.c  |  7 ++++++-
 fs/nfs/nfs4state.c | 10 +++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 158c3d52146f..62fc8eed53cc 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8153,6 +8153,12 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf
 		/* fall through */
 	case -NFS4ERR_RETRY_UNCACHED_REP:
 		return -EAGAIN;
+	case -NFS4ERR_BADSESSION:
+	case -NFS4ERR_DEADSESSION:
+	case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
+		nfs4_schedule_session_recovery(clp->cl_session,
+				task->tk_status);
+		break;
 	default:
 		nfs4_schedule_lease_recovery(clp);
 	}
@@ -8231,7 +8237,6 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
 	if (status == 0)
 		status = task->tk_status;
 	rpc_put_task(task);
-	return 0;
 out:
 	dprintk("<-- %s status=%d\n", __func__, status);
 	return status;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 8156bad6b441..b34de036501b 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1649,13 +1649,14 @@ static void nfs4_state_start_reclaim_reboot(struct nfs_client *clp)
 	nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot);
 }
 
-static void nfs4_reclaim_complete(struct nfs_client *clp,
+static int nfs4_reclaim_complete(struct nfs_client *clp,
 				 const struct nfs4_state_recovery_ops *ops,
 				 struct rpc_cred *cred)
 {
 	/* Notify the server we're done reclaiming our state */
 	if (ops->reclaim_complete)
-		(void)ops->reclaim_complete(clp, cred);
+		return ops->reclaim_complete(clp, cred);
+	return 0;
 }
 
 static void nfs4_clear_reclaim_server(struct nfs_server *server)
@@ -1702,13 +1703,16 @@ static void nfs4_state_end_reclaim_reboot(struct nfs_client *clp)
 {
 	const struct nfs4_state_recovery_ops *ops;
 	struct rpc_cred *cred;
+	int err;
 
 	if (!nfs4_state_clear_reclaim_reboot(clp))
 		return;
 	ops = clp->cl_mvops->reboot_recovery_ops;
 	cred = nfs4_get_clid_cred(clp);
-	nfs4_reclaim_complete(clp, ops, cred);
+	err = nfs4_reclaim_complete(clp, ops, cred);
 	put_rpccred(cred);
+	if (err == -NFS4ERR_CONN_NOT_BOUND_TO_SESSION)
+		set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state);
 }
 
 static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp)
-- 
2.9.3


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

* Re: [PATCH] NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION
  2017-05-04 19:41 [PATCH] NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION Trond Myklebust
@ 2017-05-05 15:59 ` Chuck Lever
  0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2017-05-05 15:59 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Linux NFS Mailing List


> On May 4, 2017, at 3:41 PM, Trond Myklebust <trond.myklebust@primarydata.com> wrote:
> 
> If the server returns NFS4ERR_CONN_NOT_BOUND_TO_SESSION because we
> are trunking, then RECLAIM_COMPLETE must handle that by calling
> nfs4_schedule_session_recovery() and then retrying.
> 
> Reported-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

I successfully ran iozone workloads with the following mount options
between my Linux server and client, both of which had a keytab:

 vers=4.1,sec=sys,proto=tcp,nconnect=2
 vers=4.1,sec=sys,proto=tcp,nconnect=3
 vers=4.1,sec=sys,proto=tcp,nconnect=4
 vers=4.1,sec=sys,proto=tcp,nconnect=5

 vers=4.1,sec=sys,proto=rdma,port=20049,nconnect=2
 vers=4.1,sec=sys,proto=rdma,port=20049,nconnect=3
 vers=4.1,sec=sys,proto=rdma,port=20049,nconnect=4
 vers=4.1,sec=sys,proto=rdma,port=20049,nconnect=5


Tested-by: Chuck Lever <chuck.lever@oracle.com>


> ---
> fs/nfs/nfs4proc.c  |  7 ++++++-
> fs/nfs/nfs4state.c | 10 +++++++---
> 2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 158c3d52146f..62fc8eed53cc 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -8153,6 +8153,12 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf
> 		/* fall through */
> 	case -NFS4ERR_RETRY_UNCACHED_REP:
> 		return -EAGAIN;
> +	case -NFS4ERR_BADSESSION:
> +	case -NFS4ERR_DEADSESSION:
> +	case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
> +		nfs4_schedule_session_recovery(clp->cl_session,
> +				task->tk_status);
> +		break;
> 	default:
> 		nfs4_schedule_lease_recovery(clp);
> 	}
> @@ -8231,7 +8237,6 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
> 	if (status == 0)
> 		status = task->tk_status;
> 	rpc_put_task(task);
> -	return 0;
> out:
> 	dprintk("<-- %s status=%d\n", __func__, status);
> 	return status;
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 8156bad6b441..b34de036501b 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -1649,13 +1649,14 @@ static void nfs4_state_start_reclaim_reboot(struct nfs_client *clp)
> 	nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot);
> }
> 
> -static void nfs4_reclaim_complete(struct nfs_client *clp,
> +static int nfs4_reclaim_complete(struct nfs_client *clp,
> 				 const struct nfs4_state_recovery_ops *ops,
> 				 struct rpc_cred *cred)
> {
> 	/* Notify the server we're done reclaiming our state */
> 	if (ops->reclaim_complete)
> -		(void)ops->reclaim_complete(clp, cred);
> +		return ops->reclaim_complete(clp, cred);
> +	return 0;
> }
> 
> static void nfs4_clear_reclaim_server(struct nfs_server *server)
> @@ -1702,13 +1703,16 @@ static void nfs4_state_end_reclaim_reboot(struct nfs_client *clp)
> {
> 	const struct nfs4_state_recovery_ops *ops;
> 	struct rpc_cred *cred;
> +	int err;
> 
> 	if (!nfs4_state_clear_reclaim_reboot(clp))
> 		return;
> 	ops = clp->cl_mvops->reboot_recovery_ops;
> 	cred = nfs4_get_clid_cred(clp);
> -	nfs4_reclaim_complete(clp, ops, cred);
> +	err = nfs4_reclaim_complete(clp, ops, cred);
> 	put_rpccred(cred);
> +	if (err == -NFS4ERR_CONN_NOT_BOUND_TO_SESSION)
> +		set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state);
> }
> 
> static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp)
> -- 
> 2.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
Chuck Lever




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

end of thread, other threads:[~2017-05-05 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-04 19:41 [PATCH] NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION Trond Myklebust
2017-05-05 15:59 ` Chuck Lever

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.