Commit 9598f64c authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Tomasz Zawadzki
Browse files

bdev/nvme: move to next nsid on nvme_ns_alloc() failure



The while() loop would just continously use the same nsid when nvme_ns_alloc()
fails. Right now it only fails on allocation failures, not really any action
that would help with progressin the namespace attachment.
Just move onto next nsid in this case.

Issue found by code inspection.

Change-Id: Ib6c13174521e5d887e28f7478c6ad531cb167935
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26521


Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@nutanix.com>
parent df4de645
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5175,6 +5175,7 @@ nvme_ctrlr_populate_namespaces(struct nvme_ctrlr *nvme_ctrlr,
			if (nvme_ns == NULL) {
				NVME_CTRLR_ERRLOG(nvme_ctrlr, "Failed to allocate namespace\n");
				/* This just fails to attach the namespace. It may work on a future attempt. */
				nsid = spdk_nvme_ctrlr_get_next_active_ns(ctrlr, nsid);
				continue;
			}