locking/lockdep: Fix the dep path printing for backwards BFS
authorBoqun Feng <boqun.feng@gmail.com>
Fri, 18 Jun 2021 17:01:07 +0000 (01:01 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 22 Jun 2021 14:42:06 +0000 (16:42 +0200)
commit69c7a5fb2482636f525f016c8333fdb9111ecb9d
treeb6a3e9053352bfbdb32e7a10eb3d12381ed7ecd5
parent7cb5dd8e2c8ce2b8f778f37cfd8bb955d663d16d
locking/lockdep: Fix the dep path printing for backwards BFS

We use the same code to print backwards lock dependency path as the
forwards lock dependency path, and this could result into incorrect
printing because for a backwards lock_list ->trace is not the call trace
where the lock of ->class is acquired.

Fix this by introducing a separate function on printing the backwards
dependency path. Also add a few comments about the printing while we are
at it.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210618170110.3699115-2-boqun.feng@gmail.com
kernel/locking/lockdep.c