• Keith Busch's avatar
    NVMe: Fix namespace removal deadlock · 646017a6
    Keith Busch authored
    This patch makes nvme namespace removal lockless. It is up to the caller
    to ensure no active namespace scanning is occuring. To ensure no scan
    work occurs, the nvme pci driver adds a removing state to the controller
    device to avoid queueing scan work during removal. The work is flushed
    after setting the state, so no new scan work can be queued.
    
    The lockless removal allows the driver to cleanup a namespace
    request_queue if the controller fails during removal. Previously this
    could deadlock trying to acquire the namespace mutex in order to handle
    such events.
    Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
    Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    646017a6
nvme.h 8.02 KB