Loading
bdev/nvme: prevent ns populate before ctrlr registration
This is a race between receiving the ANA log page callback and controller registration. It can lead to obtaining an I/O channel on an not registered controller. If an AER with a namespace change notification arrives before nvme_ctrlr_init_ana_log_page_done, the following flow might occur: nvme_bdev_add_ns -> nvme_bdev_for_each_channel -> bdev_nvme_add_io_path -> _bdev_nvme_add_io_path -> spdk_get_io_channel or spdk_bdev_get_io_channel -> (...) -> bdev_nvme_create_bdev_channel_cb -> _bdev_nvme_add_io_path -> spdk_get_io_channel Fix by registering the AER callback after the controller is registered. Change-Id: Ia91df81e9dadb850a0032c43d9bb24edaaab1393 Signed-off-by:Jacek Kalwas <jacek.kalwas@nutanix.com> Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26925 Tested-by:
SPDK Automated Test System <spdkbot@gmail.com> Reviewed-by:
Tomasz Zawadzki <tomasz@tzawadzki.com> Reviewed-by:
Shuhei Matsumoto <smatsumoto@nvidia.com> Community-CI: Mellanox Build Bot