From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: "Stephen R. van den Berg" <srb-PCMv+cxZuL0@public.gmane.org>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-nfs@vger.kernel.org
Subject: Re: Fw: Deadlock regression in v2.6.31.6
Date: Fri, 27 Nov 2009 16:23:56 -0500 [thread overview]
Message-ID: <1259357036.3486.38.camel@localhost> (raw)
In-Reply-To: <64b4daae0911261614l471fb74fx79db2988f0c65738-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, 2009-11-27 at 01:14 +0100, Stephen R. van den Berg wrote:
> On Fri, Nov 27, 2009 at 01:07, Stephen R. van den Berg <srb-PCMv+cxZuL0@public.gmane.org> wrote:
> > RPC: worker connecting xprt cfa94400 to address: addr=1.2.3.151
> > port=2049 proto=tcp
> > RPC: cfa94400 connect status 99 connected 0 sock state 7
>
> errno 99 means EADDRNOTAVAIL. In userspace this normally is solved by
> using the REUSEADDR sockopt. In xprtsock.c we try something like:
>
> /* We're probably in TIME_WAIT. Get rid of existing socket,
> * and retry
> */
> set_bit(XPRT_CONNECTION_CLOSE, &xprt->state);
> xprt_force_disconnect(xprt);
>
> I'd guess that this needs to be fixed, or the REUSEADDR sockopt needs to be set.
Does the following patch fix matters?
Trond
---------------------------------------------------------------------------------------------------------
SUNRPC: Ensure that we honour autoclose before attempting to reconnect
From: Trond Myklebust <Trond.Myklebust@netapp.com>
If the XPRT_CLOSE_WAIT flag is set, we need to ensure that we call
xprt->ops->close() while holding xprt_lock_write() before we can
start reconnecting.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
net/sunrpc/xprt.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index fd46d42..469de29 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -700,6 +700,10 @@ void xprt_connect(struct rpc_task *task)
}
if (!xprt_lock_write(xprt, task))
return;
+
+ if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xprt->state))
+ xprt->ops->close(xprt);
+
if (xprt_connected(xprt))
xprt_release_write(xprt, task);
else {
next prev parent reply other threads:[~2009-11-27 21:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 7:35 Fw: Deadlock regression in v2.6.31.6 Andrew Morton
2009-11-25 8:56 ` Stephen R. van den Berg
[not found] ` <64b4daae0911250056g3364d24l98850a272dcfe483-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-25 9:00 ` Stephen R. van den Berg
2009-11-25 14:31 ` Trond Myklebust
2009-11-25 21:58 ` Stephen R. van den Berg
2009-11-25 23:11 ` Stephen R. van den Berg
[not found] ` <64b4daae0911251511q7a070b0aj1c07cdc5d6719b41-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-26 15:01 ` Trond Myklebust
2009-11-26 15:07 ` Stephen R. van den Berg
[not found] ` <64b4daae0911260707i4064f608w4f7169441640567-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-26 15:20 ` Trond Myklebust
2009-11-27 0:07 ` Stephen R. van den Berg
[not found] ` <64b4daae0911261607m10d1ba3al8c067f85249c198f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-27 0:14 ` Stephen R. van den Berg
[not found] ` <64b4daae0911261614l471fb74fx79db2988f0c65738-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-27 21:23 ` Trond Myklebust [this message]
2009-11-28 0:20 ` Stephen R. van den Berg
[not found] ` <64b4daae0911271620k46a99666td81528fc863e69f0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-28 15:30 ` Trond Myklebust
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=1259357036.3486.38.camel@localhost \
--to=trond.myklebust@fys.uio.no \
--cc=akpm@linux-foundation.org \
--cc=linux-nfs@vger.kernel.org \
--cc=srb-PCMv+cxZuL0@public.gmane.org \
/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