]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: list: fix incorrect pointer unlocking in LIST_DEL_LOCKED()
authorWilly Tarreau <w@1wt.eu>
Wed, 13 Mar 2019 13:03:28 +0000 (14:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 Mar 2019 13:15:54 +0000 (14:15 +0100)
Injecting on a saturated listener started to exhibit some deadlocks
again between LIST_POP_LOCKED() and LIST_DEL_LOCKED(). Olivier found
it was due to a leftover from a previous debugging session. This patch
fixes it.

This will have to be backported if the other LIST_*_LOCKED() patches
are backported.

include/common/mini-clist.h

index 074176a2088a6cde3ad7702ee5afd041ebec2a2c..6088c41f73b9fd61d5cc99f289fd16c5dedc145b 100644 (file)
@@ -263,7 +263,7 @@ struct cond_wordlist {
                                n2 = HA_ATOMIC_XCHG(&n->p, LLIST_BUSY);    \
                                if (n2 == LLIST_BUSY) {                    \
                                        if (p2 != NULL)                    \
-                                               p2->n = (el);              \
+                                               p->n = p2;                 \
                                        (el)->p = p;                       \
                                        (el)->n = n;                       \
                                        __ha_barrier_store();              \