From 9b4a0e6bace4e6ecd523a8d303abc948ee46aefd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 25 Feb 2022 09:56:29 +0100 Subject: [PATCH] BUG/MINOR: debug: fix get_tainted() to properly read an atomic value get_tainted() was using an atomic store from the atomic value to a local one instead of using an atomic load. In practice it has no effect given the relatively rare updates of this field and the fact that it's read only when dumping "show info" output, but better fix it. There's probably no need to backport this. --- src/haproxy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 0010e90f9e..7a659f798c 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1456,9 +1456,7 @@ void mark_tainted(const enum tainted_flags flag) unsigned int get_tainted() { - int tainted_state; - HA_ATOMIC_STORE(&tainted_state, tainted); - return tainted_state; + return HA_ATOMIC_LOAD(&tainted); } -- 2.47.3