1 commit c4a54648f510771e792ed0c0bc16e4cf8be8bb9a
2 Author: Willy Tarreau <w@1wt.eu>
3 Date: Thu Feb 28 16:51:28 2019 +0100
5 BUG/MEDIUM: list: correct fix for LIST_POP_LOCKED's removal of last element
7 As seen with Olivier, in the end the fix in commit 285192564 ("BUG/MEDIUM:
8 list: fix LIST_POP_LOCKED's removal of the last pointer") is wrong,
9 the code there was right but the bug was triggered by another bug in
10 LIST_ADDQ_LOCKED() which doesn't properly update the list's head by
11 inserting in the wrong order.
13 This will have to be backported if the commit above is backported.
15 (cherry picked from commit 4ef6801cd4db450b4ac3a21e58ca5fce5256189b)
16 Signed-off-by: Willy Tarreau <w@1wt.eu>
17 (cherry picked from commit 92f771c7efd9a82ef189d2be7c2fcfa6a6703e07)
18 Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
20 diff --git a/include/common/mini-clist.h b/include/common/mini-clist.h
21 index d4861ccc..9ad53aa0 100644
22 --- a/include/common/mini-clist.h
23 +++ b/include/common/mini-clist.h
24 @@ -216,9 +216,9 @@ struct cond_wordlist {
27 __ha_barrier_store(); \
30 __ha_barrier_store(); \
33 __ha_barrier_store(); \
36 @@ -299,7 +299,7 @@ struct cond_wordlist {
37 __ha_barrier_store(); \
40 - p2 = HA_ATOMIC_XCHG(&n->p, LLIST_BUSY); \
41 + p2 = HA_ATOMIC_XCHG(&n2->p, LLIST_BUSY); \
42 if (p2 == LLIST_BUSY) { \