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: Seth 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: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
f803df5129
commit
d156d2f771
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user