• K
    NVMe: Fix namespace removal deadlock · 646017a6
    Keith Busch 提交于
    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: NKeith Busch <keith.busch@intel.com>
    Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: NChristoph Hellwig <hch@lst.de>
    Signed-off-by: NJens Axboe <axboe@fb.com>
    646017a6
nvme.h 8.0 KB