[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5204B78D.4090509@windriver.com>
Date: Fri, 9 Aug 2013 17:34:05 +0800
From: Ying Xue <ying.xue@...driver.com>
To: Ding Tianhong <dingtianhong@...wei.com>
CC: Jon Maloy <jon.maloy@...csson.com>,
Allan Stephens <allan.stephens@...driver.com>,
"David S. Miller" <davem@...emloft.net>,
<tipc-discussion@...ts.sourceforge.net>,
Netdev <netdev@...r.kernel.org>, <wangweidong1@...wei.com>
Subject: Re: [PATCH v2] tipc: avoid possible deadlock while enable and disable
bearer
> 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@...wei.com>
> Signed-off-by: Ding Tianhong <dingtianhong@...wei.com>
> Cc: Ying Xue <ying.xue@...driver.com>
Ack-by: Ying Xue <ying.xue@...driver.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));
> }
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists