From nobody Tue Sep 10 02:31:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X2nl04zhkz5WKCP; Tue, 10 Sep 2024 02:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X2nl04X47z4m4k; Tue, 10 Sep 2024 02:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725935484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vE9MFBaJ0+ZkNgmN/tAlneTgI9W5ubwcbuni9ZTtPsQ=; b=kXXl4voLQxGfJEC6RnzvwsZutNphBAVth4mMBi1i/rWEOxxmifiCNwUCaA7SEGlmnw3eHP DoCVFs/L4cAP+RunKTNIaJCH30r3LNwqtu9hJPMC5i8uqtw2QEQ2GovWcB7Qd9WO3DVYrS wIz7h0mh8ORaj0JogrK2qWy/CRVIsP1wlACkWrkK3Erf1R/suvfL0tqyJvq0dqdv/ITb1A dFWAurblKLMgbUHtqMpUjV2hIy8NXtC4SThdn7Q0CQk8I/1bf2Y/szc72W0mSoHMwa1EJo L6BgeW8mPfyua8+sAKEhZ8ntaLkRJ8jiEOkERsWmgfgPQQN6FgCpqYKzKsC68A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725935484; a=rsa-sha256; cv=none; b=GBnENRqSnwVpURDjttjQIVqMqvtJ7hFeBwR4T2Wo8nwVyTRtYcUT9K1LJHOOMdRiEkQGhe lPTXYZUrlgdrUv62dVG8CD9HzUchw7T3SugW7ITTreMt9AB1y19OMeWf2sBmDZWzzFdJug 0fm0AvpWV4D3fcZXza5TsuTpPd0Fm6qll2xOs7jCdl0nn1eQ7aGXbRnnOMcGkOWteYhhmO QKR64XgDg7xkslMnlWcP3Kbx6qQnvQaAG/heKjSDEObe7gdcfPz3V5xVdCqZEZVMMkQeuP CNL100FPKoSCHAGYbAbXR9KIjTWaEUbvr3UlY94c2eDPc2T7r1vEh2+SC6HnrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725935484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vE9MFBaJ0+ZkNgmN/tAlneTgI9W5ubwcbuni9ZTtPsQ=; b=D4xvd8UGTAI3ni5zO1kqHceLXkWXJhKwTAf+SkceZyMSc09BgjQLQ6M/naWZ2WBG9iOd2u cfnyJLktVN3F5JVhBO5Yf3crvkpuy3bTcL+5p4hh/FM8sYk7h6RKrnnGUgQ64g3J8V/3VY IT+cEgAAjzcdXPFNDRAuCyJz3a+Kya39dl2wk6TUIkofMfJdY8NOYIHmWUgivFRCo4u9Vx 3JitK4cgKP8qymTr0cP9flEtDRWDLwMCVcEc4SYXn9L3d1V8OMRa24xcTg2p9dzWeqmtDW 88FnVcIAFxsAlEAExAlNv+zl9/Bp/mYtwldG5JhJHaVOrijJoPZTcRY4KIhR5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X2nl047HzzT0w; Tue, 10 Sep 2024 02:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48A2VOxe010187; Tue, 10 Sep 2024 02:31:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48A2VOBe010184; Tue, 10 Sep 2024 02:31:24 GMT (envelope-from git) Date: Tue, 10 Sep 2024 02:31:24 GMT Message-Id: <202409100231.48A2VOBe010184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Sobolev Subject: git: a43fb3653b35 - main - mbuf: improve KASSERT(9) falure messages in the m_apply() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sobomax X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a43fb3653b35ab88b72e1277dccc26328363cdb7 Auto-Submitted: auto-generated The branch main has been updated by sobomax: URL: https://cgit.FreeBSD.org/src/commit/?id=a43fb3653b35ab88b72e1277dccc26328363cdb7 commit a43fb3653b35ab88b72e1277dccc26328363cdb7 Author: Maxim Sobolev AuthorDate: 2024-09-10 01:51:05 +0000 Commit: Maxim Sobolev 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)