Commit d156d2f7 authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

lib/nvmf: don't free ctrlr->qpair_mask early.



There are 2 messages passed between when
_nvmf_ctrlr_free_from_qpair is executed and when
nvmf_ctrlr_destruct is executed. That leaves time
when the controller->qpair_mask is not a valid
pointer, but it is still in the subsystem
controllers list.

The purpose of this patch is to close that hole.

It is part of a larger series aimed at cleaning up
the controller destruct path.

Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Change-Id: I0c0199c8392ee278f36df56f599beb10e7a46948
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3685


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f803df51
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ _nvmf_ctrlr_destruct(void *ctx)
	struct spdk_nvmf_reservation_log *log, *log_tmp;

	nvmf_ctrlr_stop_keep_alive_timer(ctrlr);

	spdk_bit_array_free(&ctrlr->qpair_mask);
	TAILQ_FOREACH_SAFE(log, &ctrlr->log_head, link, log_tmp) {
		TAILQ_REMOVE(&ctrlr->log_head, log, link);
		free(log);
+0 −2
Original line number Diff line number Diff line
@@ -866,8 +866,6 @@ _nvmf_ctrlr_free_from_qpair(void *ctx)
	spdk_bit_array_clear(ctrlr->qpair_mask, qpair_ctx->qid);
	count = spdk_bit_array_count_set(ctrlr->qpair_mask);
	if (count == 0) {
		spdk_bit_array_free(&ctrlr->qpair_mask);

		spdk_thread_send_msg(ctrlr->subsys->thread, _nvmf_ctrlr_destruct, ctrlr);
	}