Commit 25a89b2a authored by GangCao's avatar GangCao Committed by Changpeng Liu
Browse files

nvmf: return error when getting the NULL I/O channel



In the case that NVMe SSD itself has limited number of
hardware I/O QPairs, the corresponding abstraction of
I/O channel where upper module used to send I/Os down
will be NULL.

Add a check here for the NVMe-oF module and return the
error if the related I/O channel is NULL.

Change-Id: I97b799c6ecb026a01b0a414f1b49b949aa2407fd
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/416689


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 6fac5e5b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -885,6 +885,10 @@ poll_group_update_subsystem(struct spdk_nvmf_poll_group *group,
		} else if (ns != NULL && sgroup->channels[i] == NULL) {
			/* A namespace appeared but there is no channel yet */
			sgroup->channels[i] = spdk_bdev_get_io_channel(ns->desc);
			if (sgroup->channels[i] == NULL) {
				SPDK_ERRLOG("Could not allocate I/O channel.\n");
				return -ENOMEM;
			}
		} else {
			/* A namespace was present before and didn't change. */
		}