HomeFreeBSD

MFC r342557, r342559: Reimplement nvd(4) detach handling.

Description

MFC r342557, r342559: Reimplement nvd(4) detach handling.

Previous code typically crashed in case of NVMe device unplug or even clean
detach while some I/Os are still in flight. To fix this the new code calls
disk_gone() and waits for confirmation of all references gone before calling
disk_destroy(), freeing other resources and allowing controller detach.

While there, fix disk lists locking and reimplement unit numbers assignment.

Details