Commit 282463f5 authored by Changpeng Liu's avatar Changpeng Liu Committed by Jim Harris
Browse files

blobfs: exit the app after the failure of memory allocation



When testing blobfs, the allocation of cache buffer may fail
without any error information, users may get segment fault
error after that.

Change-Id: I6dc8ee4b93c6a9109aba193f599197caa4c4c383
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/422943


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 5d0db530
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -218,6 +218,11 @@ __initialize_cache(void)
					   CACHE_BUFFER_SIZE,
					   SPDK_MEMPOOL_DEFAULT_CACHE_SIZE,
					   SPDK_ENV_SOCKET_ID_ANY);
	if (!g_cache_pool) {
		SPDK_ERRLOG("Create mempool failed, you may "
			    "increase the memory and try again\n");
		assert(false);
	}
	TAILQ_INIT(&g_caches);
	pthread_spin_init(&g_caches_lock, 0);
}