From 64a47b943cd51ba23986663ee80f1884c9f76a2f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 20 May 2019 11:09:00 +0200 Subject: [PATCH] CLEANUP: memory: make the fault injection code use the OTHER_LOCK label The mem_should_fail() function sets a lock while it's building its messages, and when this was done there was no relevant label available hence the confusing use of START_LOCK. Now OTHER_LOCK is available for such use cases, so let's switch to this one instead as START_LOCK is going to disappear. --- src/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memory.c b/src/memory.c index 140671bc1..6555913de 100644 --- a/src/memory.c +++ b/src/memory.c @@ -594,7 +594,7 @@ int mem_should_fail(const struct pool_head *pool) else ret = 0; } - HA_SPIN_LOCK(START_LOCK, &mem_fail_lock); + HA_SPIN_LOCK(OTHER_LOCK, &mem_fail_lock); n = snprintf(&mem_fail_str[mem_fail_cur_idx * MEM_FAIL_MAX_CHAR], MEM_FAIL_MAX_CHAR - 2, "%d %.18s %d %d", mem_fail_cur_idx, pool->name, ret, tid); @@ -607,7 +607,7 @@ int mem_should_fail(const struct pool_head *pool) mem_fail_cur_idx++; if (mem_fail_cur_idx == MEM_FAIL_MAX_STR) mem_fail_cur_idx = 0; - HA_SPIN_UNLOCK(START_LOCK, &mem_fail_lock); + HA_SPIN_UNLOCK(OTHER_LOCK, &mem_fail_lock); return ret; }