We only should be scanning namespaces if the controller is live. Currently
we call the function just before setting it live, so fix the code up to
move the call to nvme_queue_scan to just below the state change.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Acked-by Jon Derrick: <
[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
* Do not queue new scan work when a controller is reset during
* removal.
*/
- if (dev->ctrl.state != NVME_CTRL_DELETING)
+ if (dev->ctrl.state == NVME_CTRL_LIVE)
queue_work(nvme_workq, &dev->scan_work);
}
nvme_free_queues(dev, dev->online_queues);
}
- nvme_queue_scan(dev);
return 0;
}
dev_warn(dev->ctrl.device, "failed to mark controller live\n");
goto out;
}
+
+ if (dev->online_queues > 1)
+ nvme_queue_scan(dev);
return;
out: