projects
/
haproxy-2.1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e16ecc5
)
BUG/MAJOR: memory: Don't forget to unlock the rwlock if the pool is empty.
author
Olivier Houchard
<ohouchard@haproxy.com>
Mon, 3 Feb 2020 12:03:30 +0000
(13:03 +0100)
committer
Willy Tarreau
<w@1wt.eu>
Tue, 4 Feb 2020 12:48:23 +0000
(13:48 +0100)
In __pool_get_first(), don't forget to unlock the pool lock if the pool is
empty, otherwise no writer will be able to take the lock, and as it is done
when reloading, it leads to an infinite loop on reload.
This should be backported with commit
04f5fe87d3d3a222b89420f8c1231461f55ebdeb
(cherry picked from commit
1c7c0d6b97513e79c304aaf834f83843f32a674d
)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/common/memory.h
patch
|
blob
|
history
diff --git
a/include/common/memory.h
b/include/common/memory.h
index
cafe03a
..
5071989
100644
(file)
--- a/
include/common/memory.h
+++ b/
include/common/memory.h
@@
-225,8
+225,10
@@
static inline void *__pool_get_first(struct pool_head *pool)
HA_RWLOCK_RDLOCK(POOL_LOCK, &pool->flush_lock);
cmp.free_list = pool->free_list;
do {
- if (cmp.free_list == NULL)
+ if (cmp.free_list == NULL) {
+ HA_RWLOCK_RDUNLOCK(POOL_LOCK, &pool->flush_lock);
return NULL;
+ }
new.seq = cmp.seq + 1;
__ha_barrier_load();
new.free_list = *POOL_LINK(pool, cmp.free_list);