From 012bd3b94231c046d70564106b6a349a0938039b Mon Sep 17 00:00:00 2001 From: Jiewei Ke Date: Fri, 13 Nov 2020 03:13:30 -0500 Subject: [PATCH] lib/nvmf: Notify ANA change when namespace change happens When ANA is enabled, if a new namespace is hot-added to the subsystem on the target side, the Linux host will expect to receive an ANA change notification after the namespace change one. Without the knowledge of the namespace's ANA state, the host will not register the associated block device, so users cannot see the nvme device. In this patch, ANA change is notified right after namespace change, so host will get ANA log, update the namespace's ANA state and then register the block device if it is alive. Signed-off-by: Jiewei Ke Change-Id: I2faf61d344eb6de7efb2fde3cb1013cf0efd3c2e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5097 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto --- lib/nvmf/nvmf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/nvmf/nvmf.c b/lib/nvmf/nvmf.c index c6045ac30..b220d2b4b 100644 --- a/lib/nvmf/nvmf.c +++ b/lib/nvmf/nvmf.c @@ -1233,6 +1233,7 @@ poll_group_update_subsystem(struct spdk_nvmf_poll_group *group, TAILQ_FOREACH(ctrlr, &subsystem->ctrlrs, link) { if (ctrlr->admin_qpair->group == group) { nvmf_ctrlr_async_event_ns_notice(ctrlr); + nvmf_ctrlr_async_event_ana_change_notice(ctrlr); } } }