linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Mark Lord <kernel@teksavvy.com>, <linux-nfs@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: BUG at net/sunrpc/svc_xprt.c:921
Date: Thu, 17 Jan 2013 17:24:14 +0400	[thread overview]
Message-ID: <50F7FB7E.2020503@parallels.com> (raw)
In-Reply-To: <20130117130335.GD6598@fieldses.org>

17.01.2013 17:03, J. Bruce Fields пишет:
> On Thu, Jan 17, 2013 at 09:05:51AM +0400, Stanislav Kinsbursky wrote:
>> 17.01.2013 02:51, Mark Lord пишет:
>>> On 13-01-16 12:20 AM, Stanislav Kinsbursky wrote:
>>>>
>>>> Mark, could you provide any call traces?
>>>
>>> Call traces from where/what?
>>> There's this one, posted earlier in the BUG report:
>>>
>>> kernel BUG at net/sunrpc/svc_xprt.c:921!
>>> Call Trace:
>>>   [<ffffffffa016a56a>] ? svc_recv+0xcc/0x338 [sunrpc]
>>>   [<ffffffffa0318bfc>] ? nfs_callback_authenticate+0x20/0x20 [nfsv4]
>>>   [<ffffffffa0318c19>] ? nfs4_callback_svc+0x1d/0x3c [nfsv4]
>>>   [<ffffffff810407e6>] ? kthread+0x81/0x89
>>>   [<ffffffff81040765>] ? kthread_freezable_should_stop+0x36/0x36
>>>   [<ffffffff812ea62c>] ? ret_from_fork+0x7c/0xb0
>>>   [<ffffffff81040765>] ? kthread_freezable_should_stop+0x36/0x36
>>>
>>
>> Thanks!
>> I haven't seen the bug report.
>> Could you provide the link, please?
>
> There's no bz if that's what you're asking for.
>
> See the first message in the thread for the original report:
>
> 	http://mid.gmane.org/<50F42F85.50907@teksavvy.com>
>

Thanks, Bruce.
This looks like the old issue I was trying to fix with "SUNRPC: protect service sockets lists during per-net shutdown".
So, here is the problem as I see it: there is a transport, which is processed by service thread and it's processing is racing with per-net service shutdown:

CPU#0:							CPU#1:

svc_recv						svc_close_net
svc_get_next_xprt (list_del_init(xpt_ready))
							svc_close_list (set XPT_BUSY and XPT_CLOSE)
							svc_clear_pools(xprt was gained on CPU#0 already)
							svc_delete_xprt (set XPT_DEAD)
svc_handle_xprt (is XPT_CLOSE => svc_delete_xprt()
BUG()

So, from my POW, we need some way to:
1) Skip such in-progress transports on svc_close_net() call (there is not way to detect them, or at  least I don't see one)
2) Delete the transport after somewhere after svc_xprt_received()

But there is a problem with svc_xprt_received(): there is a call for svc_xprt_put() in it (svc_recv->svc_handle_xprt->svc_xprt_received->svc_xprt_put) . And if 
we are the only user - then the transport will be destroyed. But transport is dereferenced later in svc_recv() after the svc_handle_xprt call.

What do you think, Bruce?


> --b.
>


-- 
Best regards,
Stanislav Kinsbursky

  reply	other threads:[~2013-01-17 13:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 16:17 BUG at net/sunrpc/svc_xprt.c:921 Mark Lord
2013-01-14 20:37 ` J. Bruce Fields
2013-01-15  4:16   ` Mark Lord
2013-01-15 20:56     ` J. Bruce Fields
2013-01-16  5:20       ` Stanislav Kinsbursky
2013-01-16 22:51         ` Mark Lord
2013-01-16 22:58           ` Mark Lord
2013-01-17  5:05           ` Stanislav Kinsbursky
2013-01-17 13:03             ` J. Bruce Fields
2013-01-17 13:24               ` Stanislav Kinsbursky [this message]
2013-01-17 23:41                 ` Mark Lord
2013-01-18  5:37                   ` Stanislav Kinsbursky
2013-01-18 15:48                     ` Mark Lord
2013-01-18 15:56                       ` J. Bruce Fields
2013-01-21  8:19                         ` Stanislav Kinsbursky
2013-01-20 22:51                     ` BUG at net/sunrpc/svc_xprt.c:921 (another one) Mark Lord
2013-02-12 20:52                       ` J. Bruce Fields
2013-02-13 15:00                         ` Mark Lord
2013-02-15 19:22                           ` J. Bruce Fields
2013-02-15 19:42                             ` Tom Horsley
2013-02-15 19:46                               ` J. Bruce Fields
2013-02-15 19:23                           ` [PATCH 1/2] svcrpc: make svc_age_temp_xprts enqueue under sv_lock J. Bruce Fields
2013-02-15 19:23                             ` [PATCH 2/2] svcrpc: fix rpc server shutdown races J. Bruce Fields
2013-02-15 19:33                         ` BUG at net/sunrpc/svc_xprt.c:921 (another one) Paweł Sikora
2013-02-17 15:54                           ` J. Bruce Fields
2013-02-18  7:42                             ` Paweł Sikora
2013-01-17 13:11 ` BUG at net/sunrpc/svc_xprt.c:921 Mark Lord
2013-01-17 13:53   ` J. Bruce Fields
2013-01-17 23:40     ` Mark Lord
2013-02-25 20:45     ` Mark Lord
2013-02-25 20:52       ` J. Bruce Fields
  -- strict thread matches above, loose matches on Subject: below --
2013-02-07 12:56 Tom Horsley
2013-02-08 20:58 ` J. Bruce Fields

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=50F7FB7E.2020503@parallels.com \
    --to=skinsbursky@parallels.com \
    --cc=bfields@fieldses.org \
    --cc=kernel@teksavvy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).