libnvme: Unset ctrlr on teardown.
This way we do not attempt to tear down more than once, which triggers an assert in mutex destruction.
This commit is contained in:
@@ -961,6 +961,9 @@ fail:
|
||||
|
||||
void nvme_qpair_destroy(struct nvme_qpair *qpair)
|
||||
{
|
||||
if (!qpair->ctrlr)
|
||||
return; // Not initialized.
|
||||
|
||||
if (nvme_qpair_is_admin_queue(qpair))
|
||||
_nvme_qpair_admin_qpair_destroy(qpair);
|
||||
|
||||
@@ -978,6 +981,8 @@ void nvme_qpair_destroy(struct nvme_qpair *qpair)
|
||||
}
|
||||
nvme_request_pool_destroy(qpair);
|
||||
|
||||
qpair->ctrlr = NULL;
|
||||
|
||||
pthread_mutex_destroy(&qpair->lock);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user