Commit 6e4e6cb3 authored by Abhineet Pandey's avatar Abhineet Pandey Committed by Tomasz Zawadzki
Browse files

lib/nvmf: Add more error logs to subsystem creation path



This change simply adds some more logs to subsystem create
path in case error conditions are hit.

Change-Id: I431b1431be5919a6f459c893773f8cc51a9c79c4
Signed-off-by: default avatarAbhineet Pandey <abhineet.pandey@nutanix.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22782


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent 577058d6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ spdk_nvmf_subsystem_create(struct spdk_nvmf_tgt *tgt,
	}

	if (!nvmf_nqn_is_valid(nqn)) {
		SPDK_ERRLOG("Subsystem NQN '%s' is invalid\n", nqn);
		return NULL;
	}

@@ -246,10 +247,12 @@ spdk_nvmf_subsystem_create(struct spdk_nvmf_tgt *tgt,
	/* Find a free subsystem id (sid) */
	sid = spdk_bit_array_find_first_clear(tgt->subsystem_ids, 0);
	if (sid == UINT32_MAX) {
		SPDK_ERRLOG("No free subsystem IDs are available for subsystem creation\n");
		return NULL;
	}
	subsystem = calloc(1, sizeof(struct spdk_nvmf_subsystem));
	if (subsystem == NULL) {
		SPDK_ERRLOG("Subsystem memory allocation failed\n");
		return NULL;
	}

@@ -271,6 +274,7 @@ spdk_nvmf_subsystem_create(struct spdk_nvmf_tgt *tgt,
	if (subsystem->used_listener_ids == NULL) {
		pthread_mutex_destroy(&subsystem->mutex);
		free(subsystem);
		SPDK_ERRLOG("Listener id array memory allocation failed\n");
		return NULL;
	}