Linux NFS development
 help / color / mirror / Atom feed
* [PATCH RFC] nfs4: use adaptive backoff when we get NFS4ERR_DELAY on LAYOUTGET
@ 2015-11-03 20:43 Jeff Layton
  2015-11-04 19:57 ` [PATCH v2] nfs4: use sliding delay in async calls that get NFS4ERR_DELAY Jeff Layton
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2015-11-03 20:43 UTC (permalink / raw)
  To: trond.myklebust, Anna Schumaker; +Cc: linux-nfs

Currently, we end up waiting a full 15s before reissuing the call
because we're passing in NULL for the timeout.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
---
 fs/nfs/nfs4proc.c       | 3 ++-
 include/linux/nfs_xdr.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5133bb18830e..b4098319b021 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7872,7 +7872,7 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
 			spin_unlock(&inode->i_lock);
 		goto out_restart;
 	}
-	if (nfs4_async_handle_error(task, server, state, NULL) == -EAGAIN)
+	if (nfs4_async_handle_error(task, server, state, &lgp->timeout) == -EAGAIN)
 		goto out_restart;
 out:
 	dprintk("<-- %s\n", __func__);
@@ -7990,6 +7990,7 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags)
 	lgp->res.layoutp = &lgp->args.layout;
 	lgp->res.seq_res.sr_slot = NULL;
 	nfs4_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0);
+	lgp->timeout = 0;
 
 	task = rpc_run_task(&task_setup_data);
 	if (IS_ERR(task))
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 52faf7e96c65..0ab65cb7d15b 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -250,6 +250,7 @@ struct nfs4_layoutget {
 	struct nfs4_layoutget_res res;
 	struct rpc_cred *cred;
 	gfp_t gfp_flags;
+	long timeout;
 };
 
 struct nfs4_getdeviceinfo_args {
-- 
2.4.3


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

end of thread, other threads:[~2015-11-19 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 20:43 [PATCH RFC] nfs4: use adaptive backoff when we get NFS4ERR_DELAY on LAYOUTGET Jeff Layton
2015-11-04 19:57 ` [PATCH v2] nfs4: use sliding delay in async calls that get NFS4ERR_DELAY Jeff Layton
2015-11-19 19:30   ` [PATCH] nfs: use sliding delay when LAYOUTGET gets NFS4ERR_DELAY Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox