From 63d55304e86a4d59a28f40a29680c4156b790d55 Mon Sep 17 00:00:00 2001 From: Anil Veerabhadrappa Date: Tue, 24 Mar 2020 16:45:32 -0700 Subject: [PATCH] nvmf/fc: Add FC listen addresses to target listeners Add FC listen address to target listeners table before attaching the same to the subsystem listener list. Without this fix, subsystem allow any listener provision which is very important to FC-NVMe is broken. Signed-off-by: Anil Veerabhadrappa Change-Id: I06436c0a73e65cb5f7bb3280658fcf200b975989 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1443 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- lib/nvmf/fc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/nvmf/fc.c b/lib/nvmf/fc.c index 2e3d951f4..5ead74991 100644 --- a/lib/nvmf/fc.c +++ b/lib/nvmf/fc.c @@ -3018,9 +3018,14 @@ nvmf_fc_adm_add_rem_nport_listener(struct spdk_nvmf_fc_nport *nport, bool add) spdk_nvmf_fc_create_trid(&ctx->trid, nport->fc_nodename.u.wwn, nport->fc_portname.u.wwn); - if (spdk_nvmf_subsystem_pause(subsystem, - nvmf_fc_adm_subsystem_paused_cb, - ctx)) { + + if (spdk_nvmf_tgt_listen(subsystem->tgt, &ctx->trid)) { + SPDK_ERRLOG("Failed to add transport address %s to tgt listeners\n", + ctx->trid.traddr); + free(ctx); + } else if (spdk_nvmf_subsystem_pause(subsystem, + nvmf_fc_adm_subsystem_paused_cb, + ctx)) { SPDK_ERRLOG("Failed to pause subsystem: %s\n", subsystem->subnqn); free(ctx);