From nobody Tue Mar 21 14:03:28 2023 X-Original-To: dev-commits-src-main@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 4PgtcJ5QHWz40LlM; Tue, 21 Mar 2023 14:03:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PgtcJ4dKFz3F8k; Tue, 21 Mar 2023 14:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679407408; 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=l7JYDKKsR7eVS7BIsb2L1qh6zBzwQ+fsDbZZK/LrNww=; b=KO7VxnLVHrg1nM3Fb2z5CFPzYQWZOYzhEADf7BXDtkHPLaVNhXHWFJIegeh0IMLtKp6sRM 24FA5PVFeKftrCBsCfTR7yXU+7VDo71YWjY1M1tLn70cgls3XMcvtmZh7k0+JJDMLwxwXY H/7/g5tB3Adc+ameoxcivpcPdJpYE6pADS00WwVegNwb5siYy7mUd+I1c2oh+1rzE9oCCD 6jRsgVbr5TXp3xZuuBnw06sxItXxYNBVkmbqL54uIV80DO+/A0TCHr3PIGx22WFYiEgnK7 FHUjNlJzFIciejr7q9pZeA7bNeM0nsL1YX8+ZJueFfogQVNbeX7Uj54LiWY9ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679407408; 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=l7JYDKKsR7eVS7BIsb2L1qh6zBzwQ+fsDbZZK/LrNww=; b=Qx6gmpbmBw/M8SYo/68I6oVyzZeb0hRX+1+T5XvoYfr8GHB7Bstdt5vkfGzCpHdJmxoGOR x8/vN9cS0tuqrWP61Gkd1X+cFbYSM/Dp5zZEJuyNSL88W1C/HohLZglF+5qTbjjRzFABW3 Sg0Q0TuEhuoT2XoCmD8wcrVBJ4nssgtgYEWNNGnnYF5271vW1vZUDl/JUDfXWQKGOv0DAN gox+faXIJsHEjXhAVSTDaYE7ln304lvCHb0uE+8wshLO6zZm06VKcTCuAtfv9SY54cScLl hpHxowcpgs96brMKBDKYAOoIGQnlNTesd3xyEcd7X8wwtMu5L8Ap+Kq9yX5Pfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679407408; a=rsa-sha256; cv=none; b=qR3bIwKFO0drq54op8RZl/RXeDA1EYqHPH1LtXaKu4H9xxqbhp1sQNluKGiX0qhZLS7yzf YEeeJ7OvVHPDrn/mjO+zDbHL20IOZxDmDSOZKdQ8vmX7UBgtuCuDKXhPJJeLuUjSBkuv4y AZi+mwJTsuYV208fTOFxfsMrDNCXubGfgLnG+t08TxfZqYL1ogp9sFiuQ/wdrwtOQRkrs3 du8fyFO8F9Yc1oc1nwlqeBrUJQKPjsHx7B42j+3RG/zCZf8Oge4MhY29/eHEpVOnpVHtg+ nsIWVR5ENzuhj0dmNGULAmxZX6hS7AlvddVzVTnzjedqxlb65cFeUlhrqyEnbQ== 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 4PgtcJ3gWhzFjF; Tue, 21 Mar 2023 14:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32LE3SN4093755; Tue, 21 Mar 2023 14:03:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32LE3SHP093753; Tue, 21 Mar 2023 14:03:28 GMT (envelope-from git) Date: Tue, 21 Mar 2023 14:03:28 GMT Message-Id: <202303211403.32LE3SHP093753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 87bb53cb5380 - main - gvinum: correct assertions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87bb53cb538059a3085db1fa4295dde5fcba55fe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=87bb53cb538059a3085db1fa4295dde5fcba55fe commit 87bb53cb538059a3085db1fa4295dde5fcba55fe Author: Ed Maste AuthorDate: 2022-12-12 17:08:39 +0000 Commit: Ed Maste CommitDate: 2023-03-21 14:03:12 +0000 gvinum: correct assertions Pointer addresses are always >= 0. Assert that the value is >= 0 instead. PR: 207855, 207856 Reviewed by: imp Reported by: David Binderman Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37677 --- sys/geom/vinum/geom_vinum_plex.c | 2 +- sys/geom/vinum/geom_vinum_raid5.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c index b217cff7d6ab..1f39204b9e07 100644 --- a/sys/geom/vinum/geom_vinum_plex.c +++ b/sys/geom/vinum/geom_vinum_plex.c @@ -173,7 +173,7 @@ gv_plex_offset(struct gv_plex *p, off_t boff, off_t bcount, off_t *real_off, return (GV_ERR_ISBUSY); *sdno = stripeno % sdcount; - KASSERT(sdno >= 0, ("gv_plex_offset: sdno < 0")); + KASSERT(*sdno >= 0, ("gv_plex_offset: sdno < 0")); stripestart = (stripeno / sdcount) * p->stripesize; KASSERT(stripestart >= 0, ("gv_plex_offset: stripestart < 0")); diff --git a/sys/geom/vinum/geom_vinum_raid5.c b/sys/geom/vinum/geom_vinum_raid5.c index 43a6a8bce330..ecc3ae99b56b 100644 --- a/sys/geom/vinum/geom_vinum_raid5.c +++ b/sys/geom/vinum/geom_vinum_raid5.c @@ -602,7 +602,7 @@ gv_raid5_offset(struct gv_plex *p, off_t boff, off_t bcount, off_t *real_off, /* The number of the subdisk containing the parity stripe. */ psd = sdcount - 1 - ( boff / (p->stripesize * (sdcount - 1))) % sdcount; - KASSERT(psdno >= 0, ("gv_raid5_offset: psdno < 0")); + KASSERT(psd >= 0, ("gv_raid5_offset: psdno < 0")); /* Offset of the start address from the start of the stripe. */ stripeoff = boff % (p->stripesize * (sdcount - 1)); @@ -610,7 +610,7 @@ gv_raid5_offset(struct gv_plex *p, off_t boff, off_t bcount, off_t *real_off, /* The number of the subdisk where the stripe resides. */ sd = stripeoff / p->stripesize; - KASSERT(sdno >= 0, ("gv_raid5_offset: sdno < 0")); + KASSERT(sd >= 0, ("gv_raid5_offset: sdno < 0")); /* At or past parity subdisk. */ if (sd >= psd)