Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Feb 2025 18:09:22 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ea03febed528 - main - netlink: fix a panic with verbose debugging printfs
Message-ID:  <202502051809.515I9McD082602@gitrepo.freebsd.org>

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

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

commit ea03febed52855247691ded13be97125fbf984f3
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-02-05 18:09:06 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-02-05 18:09:06 +0000

    netlink: fix a panic with verbose debugging printfs
    
    While here improve general debugging of this function.
    
    Fixes:  660bd40a598a498ad850911772fcff3f2511875a
---
 sys/netlink/netlink_domain.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c
index 7fabb222665e..a7ceae687d86 100644
--- a/sys/netlink/netlink_domain.c
+++ b/sys/netlink/netlink_domain.c
@@ -557,8 +557,6 @@ nl_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
 
 	MPASS(m == NULL && uio != NULL);
 
-        NL_LOG(LOG_DEBUG2, "sending message to kernel");
-
 	if (__predict_false(control != NULL)) {
 		m_freem(control);
 		return (EINVAL);
@@ -570,8 +568,6 @@ nl_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
 	if (__predict_false(uio->uio_resid < sizeof(struct nlmsghdr)))
 		return (ENOBUFS);		/* XXXGL: any better error? */
 
-	NL_LOG(LOG_DEBUG3, "sending message to kernel async processing");
-
 	error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags));
 	if (error)
 		return (error);
@@ -585,6 +581,8 @@ nl_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
 	if (__predict_false(error))
 		goto out;
 
+        NL_LOG(LOG_DEBUG2, "sending message to kernel %u bytes", nb->datalen);
+
 	SOCK_SENDBUF_LOCK(so);
 restart:
 	if (sb->sb_hiwat - sb->sb_ccc >= nb->datalen) {
@@ -607,7 +605,7 @@ restart:
 	SOCK_SENDBUF_UNLOCK(so);
 
 	if (nb == NULL) {
-		NL_LOG(LOG_DEBUG3, "enqueue %u bytes", nb->datalen);
+		NL_LOG(LOG_DEBUG3, "success");
 		NLP_LOCK(nlp);
 		nl_schedule_taskqueue(nlp);
 		NLP_UNLOCK(nlp);
@@ -615,8 +613,10 @@ restart:
 
 out:
 	SOCK_IO_SEND_UNLOCK(so);
-	if (nb != NULL)
+	if (nb != NULL) {
+		NL_LOG(LOG_DEBUG3, "failure, error %d", error);
 		nl_buf_free(nb);
+	}
 	return (error);
 }
 



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