Re: [PATCH net] tipc: eliminate possible recursive locking detected by LOCKDEP
From: David Miller
Date: Thu Oct 11 2018 - 13:26:07 EST
From: Ying Xue <ying.xue@xxxxxxxxxxxxx>
Date: Thu, 11 Oct 2018 19:57:56 +0800
> When booting kernel with LOCKDEP option, below warning info was found:
>
> WARNING: possible recursive locking detected
> 4.19.0-rc7+ #14 Not tainted
...
> The reason why the noise above was complained by LOCKDEP is because we
> nested to hold l->wakeupq.lock and l->inputq->lock in tipc_link_reset
> function. In fact it's unnecessary to move skb buffer from l->wakeupq
> queue to l->inputq queue while holding the two locks at the same time.
> Instead, we can move skb buffers in l->wakeupq queue to a temporary
> list first and then move the buffers of the temporary list to l->inputq
> queue, which is also safe for us.
>
> Fixes: 3f32d0be6c16 ("tipc: lock wakeup & inputq at tipc_link_reset()")
> Reported-by: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> Signed-off-by: Ying Xue <ying.xue@xxxxxxxxxxxxx>
Applied.