[PATCH] nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem()

Keith Busch kbusch at kernel.org
Mon Nov 16 08:18:29 PST 2026


On Wed, 11 Nov 2026 17:46:31 -0500, Mani Tofigh wrote:
> Connecting a controller to a new subsystem deadlocks when
> sysfs_create_link() fails in nvme_init_subsystem(), e.g., on an
> allocation failure.  The error path drops the last subsystem reference
> with nvme_subsystems_lock held and nvme_destroy_subsystem() takes the
> same lock again:
> 
>   nvme nvme0: failed to create sysfs link from subsystem.
>   ============================================
>   WARNING: possible recursive locking detected
>   ...
>   nvmesubsys/95 is trying to acquire lock:
>   (nvme_subsystems_lock){+.+.}-{4:4}, at: nvme_destroy_subsystem+0x1b/0x1e0
> 
> [...]

Thanks, applied to nvme-7.4.

[1/1] nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem()
      commit: ba1213be15c613a1c03db69ea6480ca140a6ca00
--
Keith Busch <kbusch at kernel.org>




More information about the Linux-nvme mailing list