|
commit 66322aef6533597ed5100916696c0f552513911d
|
|
Author: Willy Tarreau <w@1wt.eu>
|
|
Date: Thu Feb 28 11:09:56 2019 +0100
|
|
|
|
BUG/MEDIUM: list: fix the rollback on addq in the locked liss
|
|
|
|
Commit a8434ec14 ("MINOR: lists: Implement locked variations.")
|
|
introduced locked lists which use the elements pointers as locks
|
|
for concurrent operations. A copy-paste typo in LIST_ADDQ_LOCKED()
|
|
causes corruption in the list in case the next pointer is already
|
|
held, as it restores the previous pointer into the next one. It
|
|
may impact the server pools.
|
|
|
|
This will have to be backported if the commit above is backported.
|
|
|
|
(cherry picked from commit bd20ad58748eafbded464f574ed84dbbdad31e8d)
|
|
Signed-off-by: Willy Tarreau <w@1wt.eu>
|
|
(cherry picked from commit d4b726dc9e1659cb7fe3508862dfa8b3d23d823a)
|
|
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
|
|
|
|
diff --git a/include/common/mini-clist.h b/include/common/mini-clist.h
|
|
index aebeec38..779f81da 100644
|
|
--- a/include/common/mini-clist.h
|
|
+++ b/include/common/mini-clist.h
|
|
@@ -208,7 +208,7 @@ struct cond_wordlist {
|
|
__ha_barrier_store(); \
|
|
n = HA_ATOMIC_XCHG(&p->n, LLIST_BUSY); \
|
|
if (n == LLIST_BUSY) { \
|
|
- (lh)->n = p; \
|
|
+ (lh)->p = p; \
|
|
__ha_barrier_store(); \
|
|
continue; \
|
|
} \
|