Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 2024 02:31:24 GMT
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a43fb3653b35 - main - mbuf: improve KASSERT(9) falure messages in the m_apply()
Message-ID:  <202409100231.48A2VOBe010184@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sobomax:

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

commit a43fb3653b35ab88b72e1277dccc26328363cdb7
Author:     Maxim Sobolev <sobomax@FreeBSD.org>
AuthorDate: 2024-09-10 01:51:05 +0000
Commit:     Maxim Sobolev <sobomax@FreeBSD.org>
CommitDate: 2024-09-10 02:30:28 +0000

    mbuf: improve KASSERT(9) falure messages in the m_apply()
    
    - Make less ambiguous;
    - extend to provide more context for post-mortem.
    
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D43776
    MFC after:      2 weeks
---
 sys/kern/uipc_mbuf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index d6b38cf8fbc8..f6ce9b5cc74b 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1439,14 +1439,16 @@ m_apply(struct mbuf *m, int off, int len,
 	KASSERT(off >= 0, ("m_apply, negative off %d", off));
 	KASSERT(len >= 0, ("m_apply, negative len %d", len));
 	while (off > 0) {
-		KASSERT(m != NULL, ("m_apply, offset > size of mbuf chain"));
+		KASSERT(m != NULL, ("m_apply, offset > size of mbuf chain "
+		    "(%d extra)", off));
 		if (off < m->m_len)
 			break;
 		off -= m->m_len;
 		m = m->m_next;
 	}
 	while (len > 0) {
-		KASSERT(m != NULL, ("m_apply, offset > size of mbuf chain"));
+		KASSERT(m != NULL, ("m_apply, length > size of mbuf chain "
+		    "(%d extra)", len));
 		count = min(m->m_len - off, len);
 		rval = m_apply_one(m, off, count, f, arg);
 		if (rval)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409100231.48A2VOBe010184>