git: 36dbd166887d - stable/12 - dt_unring_buf: set dtbd_oldest to the start of the first record

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Tue, 08 Feb 2022 16:16:48 UTC
The branch stable/12 has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=36dbd166887dd498a2707130a1f6c90583d36fc6

commit 36dbd166887dd498a2707130a1f6c90583d36fc6
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2022-01-11 13:44:04 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2022-02-08 16:16:36 +0000

    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 256c8c5df2a4bdd43afd9ec5a2f8be9374284e1e)
---
 cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
index 62c120388b18..79b22b27ff1b 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
@@ -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;