[PATCH v2 for-5.8-rc 1/6] nvme: fix possible deadlock when I/O is blocked

Christoph Hellwig hch at lst.de
Wed Jun 24 02:29:02 EDT 2020


On Tue, Jun 23, 2020 at 05:18:48PM -0700, Sagi Grimberg wrote:
> Revert fab7772bfbcf ("nvme-multipath: revalidate nvme_ns_head gendisk
> in nvme_validate_ns")
> 
> When adding a new namespace to the head disk (via nvme_mpath_set_live)
> we will see partition scan which triggers I/O on the mpath device node.
> This process will usually be triggered from the scan_work which holds
> the scan_lock. If I/O blocks (if we got ana change currently have only
> available paths but none are accessible) this can deadlock on the head
> disk bd_mutex as both partition scan I/O takes it, and head disk revalidation
> takes it to check for resize (also triggered from scan_work on a different
> path). See trace [1].
> 
> This is no longer needed since commit cb224c3af4df ("nvme: Convert to
> use set_capacity_revalidate_and_notify") which already updates resize
> info without unnecessarily revalidating the disk.

Did you look if any other revalidation gets skipped this way? E.g.
LBA size change?

>From purely the size POV this looks good, though.



More information about the Linux-nvme mailing list