haproxy/include/import
Willy Tarreau 7c69c9b51f BUG/MAJOR: plock: fix major bug in pl_take_w() introduced with EBO
When EBO was brought to pl_take_w() by plock commit 60d750d ("plock: use
EBO when waiting for readers to leave in take_w() and stow()"), a mistake
was made: the mask against which the current value of the lock is tested
excludes the first reader like in stow(), but it must not because it was
just obtained via an ldadd() which means that it doesn't count itself.

The problem this causes is that if there is exactly one reader when a
writer grabs the lock, the writer will not wait for it to leave before
starting its operations.

The solution consists in checking for any reader in the IF. However the
mask passed to pl_wait_unlock_*() must still exclude the lowest bit as
it's verified after a subsequent load.

Kudos to Remi Tricot-Le Breton for reporting and bisecting this issue
with a reproducer.

No backport is needed since this was brought in 2.9-dev3 with commit
8178a5211 ("MAJOR: threads/plock: update the embedded library again").
The code is now on par with plock commit ada70fe.
2023-10-03 08:28:12 +02:00
..
atomic-ops.h MAJOR: threads/plock: update the embedded library again 2023-08-11 19:03:35 +02:00
eb32sctree.h
eb32tree.h
eb64tree.h
ebimtree.h
ebistree.h
ebmbtree.h
ebpttree.h
ebsttree.h
ebtree-t.h
ebtree.h
ist.h MINOR: ist: add new function ist_find_range() to find a character range 2023-08-08 19:10:54 +02:00
lru.h
mjson.h
plock.h BUG/MAJOR: plock: fix major bug in pl_take_w() introduced with EBO 2023-10-03 08:28:12 +02:00
sha1.h
slz-tables.h
slz.h IMPORT: slz: implement a synchronous flush() operation 2023-06-30 16:12:36 +02:00
xxhash.h IMPORT: xxhash: update xxHash to version 0.8.2 2023-08-24 12:01:06 +02:00