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().

(cherry picked from commit 256c8c5df2)
This commit is contained in:
Andriy Gapon 2022-01-11 15:44:04 +02:00
parent b76c310366
commit 36dbd16688

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;