BUG/MEDIUM: list: correct fix for LIST_POP_LOCKED's removal of last element

As seen with Olivier, in the end the fix in commit 285192564 ("BUG/MEDIUM:
list: fix LIST_POP_LOCKED's removal of the last pointer") is wrong,
the code there was right but the bug was triggered by another bug in
LIST_ADDQ_LOCKED() which doesn't properly update the list's head by
inserting in the wrong order.

This will have to be backported if the commit above is backported.
This commit is contained in:
Willy Tarreau 2019-02-28 16:51:28 +01:00
parent 82c9789ac4
commit 4ef6801cd4

View File

@ -216,9 +216,9 @@ struct cond_wordlist {
(el)->n = n; \
(el)->p = p; \
__ha_barrier_store(); \
n->p = (el); \
n->n = (el); \
__ha_barrier_store(); \
p->n = (el); \
p->p = (el); \
__ha_barrier_store(); \
break; \
} \
@ -299,7 +299,7 @@ struct cond_wordlist {
__ha_barrier_store(); \
continue; \
} \
p2 = HA_ATOMIC_XCHG(&n->p, LLIST_BUSY); \
p2 = HA_ATOMIC_XCHG(&n2->p, LLIST_BUSY); \
if (p2 == LLIST_BUSY) { \
n->n = n2; \
n->p = p; \