examples/abort: free qpairs at the end
It'll make it easier to handle errors in the following patch. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: Ic1a40ef59cff058d7926b3df4a966e5e6de9b0f7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16646 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
parent
9c04e6d832
commit
924a61bfa6
@ -437,7 +437,7 @@ work_fn(void *arg)
|
||||
if (ns_ctx->qpair == NULL) {
|
||||
fprintf(stderr, "spdk_nvme_ctrlr_alloc_io_qpair failed\n");
|
||||
worker->status = -ENOMEM;
|
||||
return 1;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,8 +477,6 @@ work_fn(void *arg)
|
||||
if (ns_ctx->current_queue_depth > 0) {
|
||||
spdk_nvme_qpair_process_completions(ns_ctx->qpair, 0);
|
||||
unfinished_ctx++;
|
||||
} else {
|
||||
spdk_nvme_ctrlr_free_io_qpair(ns_ctx->qpair);
|
||||
}
|
||||
}
|
||||
} while (unfinished_ctx > 0);
|
||||
@ -497,8 +495,12 @@ work_fn(void *arg)
|
||||
}
|
||||
} while (unfinished_ctx > 0);
|
||||
}
|
||||
out:
|
||||
TAILQ_FOREACH(ns_ctx, &worker->ns_ctx, link) {
|
||||
spdk_nvme_ctrlr_free_io_qpair(ns_ctx->qpair);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return worker->status != 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user