From d0d85d2e364b1a8dffd605de18469c9f300aae32 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 22 Feb 2023 15:36:03 +0100 Subject: [PATCH] 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. --- src/ring.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ring.c b/src/ring.c index 22ac30475..ae7438b36 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);