From: Jim Garlick <garlick@llnl.gov>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: "levinsasha928@gmail.com" <levinsasha928@gmail.com>,
"ericvh@gmail.com" <ericvh@gmail.com>,
"oleg@redhat.com" <oleg@redhat.com>,
"eric.dumazet@gmail.com" <eric.dumazet@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuznet@ms2.inr.ac.ru" <kuznet@ms2.inr.ac.ru>,
"jmorris@namei.org" <jmorris@namei.org>,
"yoshfuji@linux-ipv6.org" <yoshfuji@linux-ipv6.org>,
"kaber@trash.net" <kaber@trash.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"davej@redhat.com" <davej@redhat.com>
Subject: Re: ipv6: tunnel: hang when destroying ipv6 tunnel
Date: Fri, 6 Apr 2012 11:09:05 -0700 [thread overview]
Message-ID: <20120406180905.GA10835@llnl.gov> (raw)
In-Reply-To: <201204062044.EJE13062.OLMQtSVFHOFOJF@I-love.SAKURA.ne.jp>
Hi Tetsuo,
I am sorry if my patch is causing you grief!
On Fri, Apr 06, 2012 at 04:44:37AM -0700, Tetsuo Handa wrote:
> Tetsuo Handa wrote:
> > Most suspicious change is net/9p/client.c because it is changing handling of
> > ERESTARTSYS case.
> >
> > --- linux-3.3.1/net/9p/client.c
> > +++ linux-next/net/9p/client.c
> > @@ -740,10 +740,18 @@
> > c->status = Disconnected;
> > goto reterr;
> > }
> > +again:
> > /* Wait for the response */
> > err = wait_event_interruptible(*req->wq,
> > req->status >= REQ_STATUS_RCVD);
> >
> > + if ((err == -ERESTARTSYS) && (c->status == Connected)
> > + && (type == P9_TFLUSH)) {
> > + sigpending = 1;
> > + clear_thread_flag(TIF_SIGPENDING);
> > + goto again;
> > + }
> > +
>
> I think this loop is bad with regard to response to SIGKILL.
> If wait_event_interruptible() was interrupted by SIGKILL, it will
> spin until req->status >= REQ_STATUS_RCVD becomes true.
> Rather,
>
> if ((c->status == Connected) && (type == P9_TFLUSH))
> err = wait_event_killable(*req->wq,
> req->status >= REQ_STATUS_RCVD);
> else
> err = wait_event_interruptible(*req->wq,
> req->status >= REQ_STATUS_RCVD);
>
> would be safer.
Does that work? What prevents p9_client_rpc() from recursing via
p9_client_flush() on receipt of SIGKILL?
> > error:
> > /*
> > * Fid is not valid even after a failed clunk
> > + * If interrupted, retry once then give up and
> > + * leak fid until umount.
> > */
> > - p9_fid_destroy(fid);
> > + if (err == -ERESTARTSYS) {
> > + if (retries++ == 0)
> > + goto again;
>
> I think it is possible that the process is interrupted again upon retrying.
> I suspect the handling of err == -ERESTARTSYS case when retries != 0.
> It is returning without calling p9_fid_destroy(), which will be
> unexpected behaviour for the various callers.
Yes but in the unlikely event that this happens, the effect is a small
memory leak for the duration of the mount. On the other hand if the
fid is destroyed without successfully informing the server, then
subsequent operations that involve new file references will fail
when that fid number is reused, and the mount becomes unusable.
> > + } else
> > + p9_fid_destroy(fid);
> > return err;
> > }
> > EXPORT_SYMBOL(p9_client_clunk);
Regards,
Jim
next prev parent reply other threads:[~2012-04-06 18:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-31 17:51 ipv6: tunnel: hang when destroying ipv6 tunnel Sasha Levin
2012-03-31 20:59 ` Eric Dumazet
2012-03-31 21:34 ` Oleg Nesterov
2012-03-31 21:43 ` Sasha Levin
2012-03-31 23:26 ` Sasha Levin
2012-04-01 3:21 ` Tetsuo Handa
2012-04-01 17:33 ` Sasha Levin
2012-04-05 14:29 ` Tetsuo Handa
2012-04-05 14:34 ` Tetsuo Handa
2012-04-06 11:44 ` Tetsuo Handa
2012-04-06 18:09 ` Jim Garlick [this message]
2012-04-07 0:06 ` Tetsuo Handa
2012-04-11 12:20 ` Sasha Levin
2012-04-01 5:07 ` Eric Dumazet
2012-04-01 16:38 ` Oleg Nesterov
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=20120406180905.GA10835@llnl.gov \
--to=garlick@llnl.gov \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=ericvh@gmail.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=levinsasha928@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=yoshfuji@linux-ipv6.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