Skip to content

Commit 6d87cd5

Browse files
kawasakikeithbusch
authored andcommitted
nvme-multipath: fix lockdep WARN due to partition scan work
Blktests test cases nvme/014, 057 and 058 fail occasionally due to a lockdep WARN. As reported in the Closes tag URL, the WARN indicates that a deadlock can happen due to the dependency among disk->open_mutex, kblockd workqueue completion and partition_scan_work completion. To avoid the lockdep WARN and the potential deadlock, cut the dependency by running the partition_scan_work not by kblockd workqueue but by nvme_wq. Reported-by: Yi Zhang <[email protected]> Closes: https://lore.kernel.org/linux-block/CAHj4cs8mJ+R_GmQm9R8ebResKAWUE8kF5+_WVg0v8zndmqd6BQ@mail.gmail.com/ Link: https://lore.kernel.org/linux-block/oeyzci6ffshpukpfqgztsdeke5ost5hzsuz4rrsjfmvpqcevax@5nhnwbkzbrpa/ Fixes: 1f02134 ("nvme-multipath: defer partition scanning") Signed-off-by: Shin'ichiro Kawasaki <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 159de7a commit 6d87cd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/multipath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static void nvme_mpath_set_live(struct nvme_ns *ns)
793793
return;
794794
}
795795
nvme_add_ns_head_cdev(head);
796-
kblockd_schedule_work(&head->partition_scan_work);
796+
queue_work(nvme_wq, &head->partition_scan_work);
797797
}
798798

799799
nvme_mpath_add_sysfs_link(ns->head);

0 commit comments

Comments
 (0)