From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [net 1/1] tipc: fix lockdep warning during node delete Date: Tue, 27 Nov 2018 16:31:32 -0800 (PST) Message-ID: <20181127.163132.16083522702492801.davem@davemloft.net> References: <1543253174-5430-1-git-send-email-jon.maloy@ericsson.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, gordan.mihaljevic@dektech.com.au, tung.q.nguyen@dektech.com.au, hoang.h.le@dektech.com.au, jon.maloy@ericsson.com, maloy@donjonn.com, xinl@redhat.com, ying.xue@windriver.com, tipc-discussion@lists.sourceforge.net To: donmalo99@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:46956 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726460AbeK1LbM (ORCPT ); Wed, 28 Nov 2018 06:31:12 -0500 In-Reply-To: <1543253174-5430-1-git-send-email-jon.maloy@ericsson.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Jon Maloy Date: Mon, 26 Nov 2018 12:26:14 -0500 > We see the following lockdep warning: ... > The reason is that the node timer handler sometimes needs to delete a > node which has been disconnected for too long. To do this, it grabs > the lock 'node_list_lock', which may at the same time be held by the > generic node cleanup function, tipc_node_stop(), during module removal. > Since the latter is calling del_timer_sync() inside the same lock, we > have a potential deadlock. > > We fix this letting the timer cleanup function use spin_trylock() > instead of just spin_lock(), and when it fails to grab the lock it > just returns so that the timer handler can terminate its execution. > This is safe to do, since tipc_node_stop() anyway is about to > delete both the timer and the node instance. > > Fixes: 6a939f365bdb ("tipc: Auto removal of peer down node instance") > Acked-by: Ying Xue > Signed-off-by: Jon Maloy Applied and queued up for -stable, thanks Jon.