Commit f37d64d6 authored by Jim Harris's avatar Jim Harris Committed by Konrad Sztyber
Browse files

event: don't print core unlock warnings if cores were never locked



If we fail app init path, we try to unlock any cores that happened
to be locked. But the code path was only checking for -1, and by
default the core lock array would have 0 values. So only try to
unlock if the core lock fd is not -1 nor 0.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I3a2f7bb8bf11c5bc3d8c59b213a356aff87b30d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25059


Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarChangpeng Liu <changpeliu@tencent.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 37b3b045
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@ static bool g_delay_subsystem_init = false;
static bool g_shutdown_sig_received = false;
static char *g_executable_name;
static struct spdk_app_opts g_default_opts;

static int g_core_locks[SPDK_CONFIG_MAX_LCORES];

static struct {
@@ -708,7 +707,7 @@ unclaim_cpu_cores(uint32_t *failed_core)
	int rc;

	for (i = 0; i < SPDK_CONFIG_MAX_LCORES; i++) {
		if (g_core_locks[i] != -1) {
		if (g_core_locks[i] != -1 && g_core_locks[i] != 0) {
			snprintf(core_name, sizeof(core_name), "/var/tmp/spdk_cpu_lock_%03d", i);
			rc = close(g_core_locks[i]);
			if (rc) {