Commit 6b7c4ce1 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

nvme: check pthread_mutex_destroy() return value



We have indications that the ctrlr_lock is being destroyed while
held in issue #3401 failures, so check the return value and assert
with an ERRLOG if it fails.

Note that it seems like even when the mutex is held,
pthread_mutex_destroy() doesn't always return failure, but it's still
better to check this return value than ignore it.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: Ic7091c2a181f953fa447d3eeccbc4350ad5c9698
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23730


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent e10b4806
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -4209,7 +4209,13 @@ nvme_ctrlr_init_cap(struct spdk_nvme_ctrlr *ctrlr)
void
nvme_ctrlr_destruct_finish(struct spdk_nvme_ctrlr *ctrlr)
{
	pthread_mutex_destroy(&ctrlr->ctrlr_lock);
	int rc;

	rc = pthread_mutex_destroy(&ctrlr->ctrlr_lock);
	if (rc) {
		SPDK_ERRLOG("could not destroy ctrlr_lock: %s\n", spdk_strerror(rc));
		assert(false);
	}

	nvme_ctrlr_free_processes(ctrlr);
}