From: Ying Xue <ying.xue@windriver.com>
To: Ding Tianhong <dingtianhong@huawei.com>
Cc: Jon Maloy <jon.maloy@ericsson.com>,
Allan Stephens <allan.stephens@windriver.com>,
"David S. Miller" <davem@davemloft.net>,
<tipc-discussion@lists.sourceforge.net>,
Netdev <netdev@vger.kernel.org>, <wangweidong1@huawei.com>
Subject: Re: [PATCH v2] tipc: avoid possible deadlock while enable and disable bearer
Date: Fri, 9 Aug 2013 17:34:05 +0800 [thread overview]
Message-ID: <5204B78D.4090509@windriver.com> (raw)
In-Reply-To: <5204B29A.80809@huawei.com>
> The problem is that the tipc_link_delete() will cancel the timer disc_timeout() when
> the b_ptr->lock is hold, but the disc_timeout() still call b_ptr->lock to finish the
> work, so the dead lock occurs.
>
> We should unlock the b_ptr->lock when del the disc_timeout().
>
> Remove link_timeout() still met the same problem, the patch:
>
> http://article.gmane.org/gmane.network.tipc.general/4380
>
> fix the problem, so no need to send patch for fix link_timeout() deadlock warming.
>
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> Cc: Ying Xue <ying.xue@windriver.com>
Ack-by: Ying Xue <ying.xue@windriver.com>
> ---
> net/tipc/bearer.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
> index cb29ef7..609c30c 100644
> --- a/net/tipc/bearer.c
> +++ b/net/tipc/bearer.c
> @@ -460,6 +460,7 @@ static void bearer_disable(struct tipc_bearer *b_ptr)
> {
> struct tipc_link *l_ptr;
> struct tipc_link *temp_l_ptr;
> + struct tipc_link_req *temp_req;
>
> pr_info("Disabling bearer <%s>\n", b_ptr->name);
> spin_lock_bh(&b_ptr->lock);
> @@ -468,9 +469,13 @@ static void bearer_disable(struct tipc_bearer *b_ptr)
> list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
> tipc_link_delete(l_ptr);
> }
> - if (b_ptr->link_req)
> - tipc_disc_delete(b_ptr->link_req);
> + temp_req = b_ptr->link_req;
> + b_ptr->link_req = NULL;
> spin_unlock_bh(&b_ptr->lock);
> +
> + if (temp_req)
> + tipc_disc_delete(temp_req);
> +
> memset(b_ptr, 0, sizeof(struct tipc_bearer));
> }
>
>
next prev parent reply other threads:[~2013-08-09 9:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 9:12 [PATCH v2] tipc: avoid possible deadlock while enable and disable bearer Ding Tianhong
2013-08-09 9:34 ` Ying Xue [this message]
2013-08-12 4:59 ` David Miller
2013-08-12 5:03 ` Ying Xue
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=5204B78D.4090509@windriver.com \
--to=ying.xue@windriver.com \
--cc=allan.stephens@windriver.com \
--cc=davem@davemloft.net \
--cc=dingtianhong@huawei.com \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=wangweidong1@huawei.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).