• Hannes Reinecke's avatar
    nvme: fix refcounting imbalance when all paths are down · 5396fdac
    Hannes Reinecke authored
    When the last path to a ns_head drops the current code
    removes the ns_head from the subsystem list, but will only
    delete the disk itself if the last reference to the ns_head
    drops. This is causing an refcounting imbalance eg when
    applications have a reference to the disk, as then they'll
    never get notified that the disk is in fact dead.
    This patch moves the call 'del_gendisk' into nvme_mpath_check_last_path(),
    ensuring that the disk can be properly removed and applications get the
    appropriate notifications.
    Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
    Reviewed-by: default avatarKeith Busch <kbusch@kernel.org>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    5396fdac
core.c 121 KB