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.
This commit is contained in:
Willy Tarreau 2023-02-22 15:36:03 +01:00
parent b7a13be6cd
commit d0d85d2e36

View File

@ -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);