nvmf: add an assert for the obtained sgroup

Change-Id: Ie00137083143722e9df50fa5a8e4d37000dfe29c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8739
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
GangCao 2021-07-12 17:07:12 -04:00 committed by Tomasz Zawadzki
parent 599303624e
commit bd4aec1cd5

View File

@ -811,6 +811,7 @@ retry_connect(void *arg)
int rc;
sgroup = nvmf_subsystem_pg_from_connect_cmd(req);
assert(sgroup != NULL);
sgroup->mgmt_io_outstanding++;
spdk_poller_unregister(&req->poller);
rc = nvmf_ctrlr_cmd_connect(req);
@ -861,6 +862,7 @@ nvmf_ctrlr_cmd_connect(struct spdk_nvmf_request *req)
* subsystem waiting for this command to complete before unpausing.
*/
sgroup = nvmf_subsystem_pg_from_connect_cmd(req);
assert(sgroup != NULL);
sgroup->mgmt_io_outstanding--;
SPDK_DEBUGLOG(nvmf, "Subsystem '%s' is not ready for connect, retrying...\n", subsystem->subnqn);
req->poller = SPDK_POLLER_REGISTER(retry_connect, req, 100);