linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: fix error handling for clients that fail to return the layout
@ 2016-10-20 16:21 Jeff Layton
  2016-10-21 12:17 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2016-10-20 16:21 UTC (permalink / raw)
  To: bfields; +Cc: hch, linux-nfs

Currently, when the client continually returns NFS4ERR_DELAY on a
CB_LAYOUTRECALL, we'll give up trying to retransmit after two lease
periods, but leave the layout in place.

What we really need to do here is fence the client in this case. Have it
fall through to that code in that case instead of into the
NFS4ERR_NOMATCHING_LAYOUT case.

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/nfsd/nfs4layouts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
index 42aace4fc4c8..596205d939a1 100644
--- a/fs/nfsd/nfs4layouts.c
+++ b/fs/nfsd/nfs4layouts.c
@@ -686,10 +686,6 @@ nfsd4_cb_layout_done(struct nfsd4_callback *cb, struct rpc_task *task)
 			return 0;
 		}
 		/* Fallthrough */
-	case -NFS4ERR_NOMATCHING_LAYOUT:
-		trace_layout_recall_done(&ls->ls_stid.sc_stateid);
-		task->tk_status = 0;
-		return 1;
 	default:
 		/*
 		 * Unknown error or non-responding client, we'll need to fence.
@@ -702,6 +698,10 @@ nfsd4_cb_layout_done(struct nfsd4_callback *cb, struct rpc_task *task)
 		else
 			nfsd4_cb_layout_fail(ls);
 		return -1;
+	case -NFS4ERR_NOMATCHING_LAYOUT:
+		trace_layout_recall_done(&ls->ls_stid.sc_stateid);
+		task->tk_status = 0;
+		return 1;
 	}
 }
 
-- 
2.7.4


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

* Re: [PATCH] nfsd: fix error handling for clients that fail to return the layout
  2016-10-20 16:21 [PATCH] nfsd: fix error handling for clients that fail to return the layout Jeff Layton
@ 2016-10-21 12:17 ` Christoph Hellwig
  2016-10-28 20:54   ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2016-10-21 12:17 UTC (permalink / raw)
  To: Jeff Layton; +Cc: bfields, hch, linux-nfs

On Thu, Oct 20, 2016 at 12:21:34PM -0400, Jeff Layton wrote:
> Currently, when the client continually returns NFS4ERR_DELAY on a
> CB_LAYOUTRECALL, we'll give up trying to retransmit after two lease
> periods, but leave the layout in place.
> 
> What we really need to do here is fence the client in this case. Have it
> fall through to that code in that case instead of into the
> NFS4ERR_NOMATCHING_LAYOUT case.

Agreed.  Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] nfsd: fix error handling for clients that fail to return the layout
  2016-10-21 12:17 ` Christoph Hellwig
@ 2016-10-28 20:54   ` J. Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2016-10-28 20:54 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Jeff Layton, linux-nfs

On Fri, Oct 21, 2016 at 02:17:59PM +0200, Christoph Hellwig wrote:
> On Thu, Oct 20, 2016 at 12:21:34PM -0400, Jeff Layton wrote:
> > Currently, when the client continually returns NFS4ERR_DELAY on a
> > CB_LAYOUTRECALL, we'll give up trying to retransmit after two lease
> > periods, but leave the layout in place.
> > 
> > What we really need to do here is fence the client in this case. Have it
> > fall through to that code in that case instead of into the
> > NFS4ERR_NOMATCHING_LAYOUT case.
> 
> Agreed.  Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Thanks, applying for 4.10.

--b.

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

end of thread, other threads:[~2016-10-28 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-20 16:21 [PATCH] nfsd: fix error handling for clients that fail to return the layout Jeff Layton
2016-10-21 12:17 ` Christoph Hellwig
2016-10-28 20:54   ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).