Current implementation of spdk_nvmf_qpair_disconnect saves and calls user's callback correctly only on the first call. If this function is called when qpair is already in the process of disconnect, the cb_fn is called immediately, that may lead to stack overflow. In most of places this function is called with cb_fn = NULL, that means that the real qpair disconnect is not important for the app logic. Only in several places (nvmf tgt shutdown flow) that is important to wait for all qpairs to be disconnected. Taking into account complexity related to possible stack overflow, do not pass the cb_fn to spdk_nvmf_qpair_disconnect. Instead, wait until a list of qpairs is empty in shutdown path. Next patches will change spdk_nvmf_qpair_disconnect behaviour when disconnect is in progress and deprecate cb_fn and ctx parameters. Fixes issue #2765 Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com> Change-Id: Ie8d49c88cc009b774b45adab3e37c4dde4395549 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17163 Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> |
||
---|---|---|
.. | ||
ctrlr_bdev.c | ||
ctrlr_discovery.c | ||
ctrlr.c | ||
fc_ls.c | ||
fc.c | ||
Makefile | ||
nvmf_fc.h | ||
nvmf_internal.h | ||
nvmf_rpc.c | ||
nvmf.c | ||
rdma.c | ||
spdk_nvmf.map | ||
subsystem.c | ||
tcp.c | ||
transport.c | ||
transport.h | ||
vfio_user.c |