+42
−2
Loading
Some NVMe-oF targets add listener and then add namespace to a subsystem. If such NVMe-oF targets reset, the subsystem can be empty temporarily when its connection is re-established. Then, namespace can be exposed again later. The NVMe-oF initiator of the NVMe bdev module could not handle reset correctly for such targets because nvme_ns->ns was not changed and it was not checked if nvme_ns->ns is non-NULL. This patch adds the following changes to fix the bug. After adminq is reconnected, check if ns exists or not. If ns does not exist, clear nvme_ns->ns to NULL. Async event callback fills nvme_ns->ns if ns is active and nvme_ns->ns is different from ns. Add check if nvme_ns->ns is not NULL to all corresponding functions. Add unit test for verification. Fixes github issue #3313 Signed-off-by:Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: Iad3c2aace56a21191a7d772981bec8b4e2047af7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22485 Reviewed-by:
Ben Walker <ben@nvidia.com> Community-CI: Mellanox Build Bot Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by:
Jim Harris <jim.harris@samsung.com>