Skip to content

Commit 91ab4b4

Browse files
jtlaytontrondmypd
authored andcommitted
nfs: use sliding delay when LAYOUTGET gets NFS4ERR_DELAY
When LAYOUTGET gets NFS4ERR_DELAY, we currently will wait 15s before retrying the call. That is a _very_ long time, so add a timeout value to struct nfs4_layoutget and pass nfs4_async_handle_error a pointer to it. This allows the RPC engine to use a sliding delay window, instead of a 15s delay. Signed-off-by: Jeff Layton <jeff.layton@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent f54423a commit 91ab4b4

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7866,7 +7866,7 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
78667866
spin_unlock(&inode->i_lock);
78677867
goto out_restart;
78687868
}
7869-
if (nfs4_async_handle_error(task, server, state, NULL) == -EAGAIN)
7869+
if (nfs4_async_handle_error(task, server, state, &lgp->timeout) == -EAGAIN)
78707870
goto out_restart;
78717871
out:
78727872
dprintk("<-- %s\n", __func__);

include/linux/nfs_xdr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ struct nfs4_layoutget {
251251
struct nfs4_layoutget_res res;
252252
struct rpc_cred *cred;
253253
gfp_t gfp_flags;
254+
long timeout;
254255
};
255256

256257
struct nfs4_getdeviceinfo_args {

0 commit comments

Comments
 (0)