From 241d04467dd79b5be05939e016c3de07e76f1664 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Fri, 10 Jan 2020 14:26:21 -0700 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/480007 Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Tested-by: SPDK CI Jenkins Community-CI: Broadcom SPDK FC-NVMe CI --- examples/nvmf/nvmf/nvmf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nvmf/nvmf/nvmf.c b/examples/nvmf/nvmf/nvmf.c index c9437ebd9..2ca577178 100644 --- a/examples/nvmf/nvmf/nvmf.c +++ b/examples/nvmf/nvmf/nvmf.c @@ -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;