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.
This commit is contained in:
Willy Tarreau 2022-02-25 09:56:29 +01:00
parent c72d2c7e5b
commit 9b4a0e6bac

View File

@ -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);
}