Re: [syzbot] [nbd?] possible deadlock in nbd_queue_rq
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: 2025-07-08 02:19:58
Also in:
lkml
On 2025/07/08 10:24, Hillf Danton wrote:
On Tue, 8 Jul 2025 09:52:18 +0900 Tetsuo Handa wrote:quoted
On 2025/07/08 9:18, Hillf Danton wrote:quoted
On Mon, 7 Jul 2025 10:39:44 -0700 Bart Van Assche wrote:quoted
On 7/6/25 5:59 PM, Hillf Danton wrote:quoted
and given the second one, the report is false positive.Whether or not this report is a false positive, the root cause should be fixed because lockdep disables itself after the first circular locking complaint. From print_usage_bug() in kernel/locking/lockdep.c: if (!debug_locks_off() || debug_locks_silent) return;The root cause could be walked around for example by trying not to init nbd more than once.How did you come to think so?Based on that nbd_init appears twice in the lock chain syzbot reported.
You might be misunderstanding what the lock chain is reporting. The stack backtrace of a lock is taken only when that lock is taken for the first time. That is, two stack backtraces from two locks might share one or more functions. Also, the stack backtrace of a lock which is printed when lockdep fired might not be a backtrace of that lock when actual deadlock happens. You need to understand all possible locking patterns (because lockdep can associate only one backtrace with one lock) before you conclude that the report is a false positive.
quoted
nbd_init() is already called only once because of module_init(nbd_init).Ok Bart is misguiding.