Re: [syzbot] [nvme?] WARNING in nvme_loop_reset_ctrl_work
From: Maurizio Lombardi
Date: Mon Sep 14 2026 - 06:21:41 EST
On Mon Sep 14, 2026 at 11:21 AM CEST, Maurizio Lombardi wrote:
> On Sun Sep 13, 2026 at 5:34 PM CEST, syzbot wrote:
>> syzbot has found a reproducer for the following issue on:
>>
>> HEAD commit: 2f0c1cf72f46 Merge tag 's390-7.3-3' of git://git.kernel.or..
>> git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> console output: https://syzkaller.appspot.com/x/log.txt?x=159b19f9580000
>> kernel config: https://syzkaller.appspot.com/x/.config?x=8c5c3949d762a91f
>> dashboard link: https://syzkaller.appspot.com/bug?extid=4a1d521d19d6321f5aad
>> compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1074f615580000
>
>
> It seems that a reset operation is enqueued before the controller
> initialization is completed.
>
> when the nvme_loop_reset_ctrl_work() finally runs, it will find the
> controller in LIVE state, thus hitting the WARN_ON().
>
Maybe moving the controller to CONNECTING state before exposing it to
sysfs will prevent the warning:
@@ -570,13 +575,13 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev,
goto out;
}
+ if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING))
+ WARN_ON_ONCE(1);
+
ret = nvme_add_ctrl(&ctrl->ctrl);
if (ret)
goto out_put_ctrl;
- if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING))
- WARN_ON_ONCE(1);
-
ret = -ENOMEM;
ctrl->ctrl.kato = opts->kato;
Maurizio