nvme: do not notify a consumer about failures that occur during initialization

MFC after:	3 days
Sponsored by:	Intel
This commit is contained in:
Jim Harris 2015-07-29 21:29:50 +00:00
parent 9c80b8aa0f
commit 0e1fd2dda3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286043

View File

@ -390,6 +390,15 @@ nvme_notify_fail_consumers(struct nvme_controller *ctrlr)
struct nvme_consumer *cons;
uint32_t i;
/*
* This controller failed during initialization (i.e. IDENTIFY
* command failed or timed out). Do not notify any nvme
* consumers of the failure here, since the consumer does not
* even know about the controller yet.
*/
if (!ctrlr->is_initialized)
return;
for (i = 0; i < NVME_MAX_CONSUMERS; i++) {
cons = &nvme_consumer[i];
if (cons->id != INVALID_CONSUMER_ID && cons->fail_fn != NULL)