example/nvmf: always return after spdk_subsystem_init

When the call to spdk_subsystem_init returns synchronously, calling the
callback results in double iterating over states in the state machine.
Returning after calling spdk_subsystem_init allows us to reliably begin
executing after the callback function is executed with no double
execution.

Change-Id: Ieb9003acece7483c956f19be4f131c8d4f64fbaa
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/480007
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
This commit is contained in:
Seth Howell 2020-01-10 14:26:21 -07:00 committed by Changpeng Liu
parent 159703c9dc
commit 241d04467d

View File

@ -716,7 +716,7 @@ nvmf_target_advance_state(void)
case NVMF_INIT_SUBSYSTEM:
/* initlize the bdev layer */
spdk_subsystem_init(nvmf_subsystem_init_done, NULL);
break;
return;
case NVMF_INIT_TARGET:
nvmf_create_nvmf_tgt();
break;