7c69c9b51f
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
|
||
---|---|---|
.. | ||
atomic-ops.h | ||
eb32sctree.h | ||
eb32tree.h | ||
eb64tree.h | ||
ebimtree.h | ||
ebistree.h | ||
ebmbtree.h | ||
ebpttree.h | ||
ebsttree.h | ||
ebtree-t.h | ||
ebtree.h | ||
ist.h | ||
lru.h | ||
mjson.h | ||
plock.h | ||
sha1.h | ||
slz-tables.h | ||
slz.h | ||
xxhash.h |