dt_unring_buf: set dtbd_oldest to the start of the first record

It was set to the start of the buffer and that can be different from the
start of teh first record because of a misalignment.

This change follows the example of dt_realloc_buf().

Reviewed by:	tsoome, markj
MFC after:	4 weeks
Differential Revision:	https://reviews.freebsd.org/D33649
This commit is contained in:
Andriy Gapon 2022-01-11 15:44:04 +02:00
parent 75bc7150f4
commit 256c8c5df2

View File

@ -2621,7 +2621,7 @@ dt_unring_buf(dtrace_hdl_t *dtp, dtrace_bufdesc_t *buf)
bcopy(buf->dtbd_data, ndp, buf->dtbd_oldest);
dt_free(dtp, buf->dtbd_data);
buf->dtbd_oldest = 0;
buf->dtbd_oldest = misalign;
buf->dtbd_data = newdata;
buf->dtbd_size += misalign;