From: Jeff Layton <jlayton@redhat.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Dickson Steve <steved@redhat.com>,
linux-nfs@vger.kernel.org, bfields@fieldses.org
Subject: Re: [PATCH 1/2] SUNRPC: Ensure that call_connect times out correctly
Date: Mon, 14 Apr 2014 13:32:28 -0400 [thread overview]
Message-ID: <20140414133228.4683d495@ipyr.poochiereds.net> (raw)
In-Reply-To: <02E852FE-5A75-4646-AAD3-A818A69C9C40@primarydata.com>
On Mon, 14 Apr 2014 12:57:58 -0400
Trond Myklebust <trond.myklebust@primarydata.com> wrote:
>
> On Apr 14, 2014, at 12:25, Jeff Layton <jlayton@redhat.com> wrote:
>
> > On Mon, 17 Mar 2014 14:40:44 -0400
> > Trond Myklebust <trond.myklebust@primarydata.com> wrote:
> >
> >> When the server is unavailable due to a networking error, etc, we want
> >> the RPC client to respect the timeout delays when attempting to reconnect.
> >>
> >> Fixes: 561ec1603171 (SUNRPC: call_connect_status should recheck bind..)
> >> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> >> ---
> >> net/sunrpc/clnt.c | 8 +++-----
> >> 1 file changed, 3 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> >> index 0edada973434..f22d3a115fda 100644
> >> --- a/net/sunrpc/clnt.c
> >> +++ b/net/sunrpc/clnt.c
> >> @@ -1798,10 +1798,6 @@ call_connect_status(struct rpc_task *task)
> >> trace_rpc_connect_status(task, status);
> >> task->tk_status = 0;
> >> switch (status) {
> >> - /* if soft mounted, test if we've timed out */
> >> - case -ETIMEDOUT:
> >> - task->tk_action = call_timeout;
> >> - return;
> >> case -ECONNREFUSED:
> >> case -ECONNRESET:
> >> case -ECONNABORTED:
> >> @@ -1812,7 +1808,9 @@ call_connect_status(struct rpc_task *task)
> >> if (RPC_IS_SOFTCONN(task))
> >> break;
> >> case -EAGAIN:
> >> - task->tk_action = call_bind;
> >> + case -ETIMEDOUT:
> >> + /* Check if we've timed out before looping back to call_bind */
> >> + task->tk_action = call_timeout;
> >> return;
> >> case 0:
> >> clnt->cl_stats->netreconn++;
> >
> > I believe this patch may have broken the v4.0 callback channel
> > establishment code in nfsd. I think what's happening is this:
> >
> > nfsd tries to create a RPC_TASK_SOFTCONN call to probe the cb channel
> > with a CB_NULL. It queues the connect_worker to the workqueue. That
> > establishes the socket and then gets a callback from the socket layer
> > into xs_tcp_state_change for TCP_ESTABLISHED.
> >
> > That code does:
> >
> > xprt_wake_pending_tasks(xprt, -EAGAIN);
> >
> > ...that wakes the task up, and sets the tk_status to -EAGAIN, and it
> > then moves on to call_timeout due to this patch. That code then does
> > this:
> >
> > if (RPC_IS_SOFTCONN(task)) {
> > rpc_exit(task, -ETIMEDOUT);
> > return;
> > }
> >
> > ...and the callback ping then fails with an error. Reverting this patch
> > seems to fix it. I see several ways that we could fix this, but I'm not
> > clear on the right way. Maybe we shouldn't be waking up the tasks with
> > -EAGAIN in the TCP_ESTABLISHED case?
>
> ...or, possibly setup_callback_client should be setting the timeparms.to_maxval to a non-zero value so that xprt_adjust_timeout() and xprt_reset_majortimeo() behave as expected.
>
> _________________________________
> Trond Myklebust
> Linux NFS client maintainer, PrimaryData
> trond.myklebust@primarydata.com
>
Well spotted. That does indeed fix it. I'll spin up a patch and send it
to Bruce.
Thanks!
--
Jeff Layton <jlayton@redhat.com>
prev parent reply other threads:[~2014-04-14 17:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 18:40 [PATCH 1/2] SUNRPC: Ensure that call_connect times out correctly Trond Myklebust
2014-03-17 18:40 ` [PATCH 2/2] SUNRPC: Ensure that call_bind " Trond Myklebust
2014-03-18 19:02 ` Steve Dickson
2014-03-18 15:47 ` [PATCH 1/2] SUNRPC: Ensure that call_connect " Steve Dickson
2014-03-18 15:58 ` Trond Myklebust
2014-03-18 17:24 ` Steve Dickson
2014-03-18 18:45 ` Trond Myklebust
2014-03-18 19:00 ` Steve Dickson
2014-03-18 19:50 ` Trond Myklebust
2014-03-19 12:39 ` Steve Dickson
2014-03-19 12:52 ` Trond Myklebust
2014-03-19 14:07 ` Steve Dickson
2014-03-19 15:04 ` Trond Myklebust
2014-03-19 17:10 ` Steve Dickson
2014-03-19 17:29 ` Trond Myklebust
2014-03-19 18:22 ` Steve Dickson
2014-03-19 19:41 ` Trond Myklebust
2014-03-20 14:12 ` Steve Dickson
2014-03-20 15:19 ` Steve Dickson
2014-03-18 18:47 ` Steve Dickson
2014-03-18 18:48 ` Steve Dickson
2014-04-14 16:25 ` Jeff Layton
2014-04-14 16:57 ` Trond Myklebust
2014-04-14 17:32 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140414133228.4683d495@ipyr.poochiereds.net \
--to=jlayton@redhat.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).