From: Willy Tarreau Date: Wed, 22 Feb 2023 14:36:03 +0000 (+0100) Subject: BUG/MINOR: ring: do not realign ring contents on resize X-Git-Tag: v2.8-dev5~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d0d85d2e364b1a8dffd605de18469c9f300aae32;p=thirdparty%2Fhaproxy.git BUG/MINOR: ring: do not realign ring contents on resize If a ring is resized, we must not zero its head since the contents are preserved in-situ. Till now it used to work because we only resize during boot and we emit very few data (if at all) during boot. But this can change in the future. This can be backported to 2.2 though no older version should notice a difference. --- diff --git a/src/ring.c b/src/ring.c index 22ac304750..ae7438b367 100644 --- a/src/ring.c +++ b/src/ring.c @@ -142,7 +142,6 @@ struct ring *ring_resize(struct ring *ring, size_t size) b_getblk(&ring->buf, area, ring->buf.data, 0); area = HA_ATOMIC_XCHG(&ring->buf.area, area); ring->buf.size = size; - ring->buf.head = 0; } HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);