From nobody Thu Mar 23 12:42:22 2023 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 4Pj4jq0NsXz41HyR; Thu, 23 Mar 2023 12:42:23 +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 4Pj4jp3zKDz4Lb0; Thu, 23 Mar 2023 12:42:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679575342; 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=9ieMeBj5Z4T5fIxALL4UFYkU12TD9b5aFiSLRP+usRI=; b=v7dan+SnjcQhigkyH8+gRKfU+scMMQ1E5ntSXVJgiBn6PisHuVjAsLhARzYDJBcNKlNccs GQ+hmigwxPADvu04lHH39knWwxhl/pCfnGgYBTq34R/eDseu9sCehBo5pm0KQGwYDqQwrz gWS1p8EDKJMUTqfIJA4L81tu7Mjy+pQz+iISrRYhDF2b5V8U46lHWJuarRAHP13rckRX6Z GxxxMl1S1PmK/tnkDuoXNbsG0P05ybviCLw9tsY+tT0WtRLbwVTOgfeD0iqXoqHh4hNt2U 7mWiV0ZecALBuPYxf3/iDVYx8E+AS9MVI54A1foVjjfW/2ivgiLOwqDeZ8Iz+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679575342; 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=9ieMeBj5Z4T5fIxALL4UFYkU12TD9b5aFiSLRP+usRI=; b=xadjZv/ZlBQwLEGCpLLqjA2ctjXxwtDPBdndkr5dxg5uOiuuJkkyzAK4/ugzvDb+jwm8Eg D6M1LoZUwH/TXGS8MiaXxVxdjbu0QxEYH7kNCU+JPhv+Ig3iY1jSmGnMtmzQ+IzMZIvEb8 UAXX5aXAO275yMgvov0IVjHWxRLaxe2p08laUrCVGsq/KWvP6zQn2VyW5oqQr8TE5U5FKN T8CU+D22Y6NsG58VSKm/m2Q/XJtP53chU+CUlO0z2eyF9dunRQkKGJIcuMiyWuAzam1J03 ETt354TJlNypVBxNYDGAknau1XIUiSKsNuXRo/2K96DUnXPkkUwoXKH2r38Bgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679575342; a=rsa-sha256; cv=none; b=BhDUftQrYt/9zgtNQu/JPz8MSv58BjMrtHkeo/4Zhp7RGZ5dEnbLjAh1mpkAlL2ckp3Br6 Sdl/xWZZyuHE0jylhjJ+m5YV95J+Pzo0Iz3hw1rbkpXqGVYfZ2EfbpUL0ASOybYDFMpZ+2 R2zsUweEU8d+LMrOYjQUD5FxQrxlMWjp4bocjNMOptcMOtuMJ5aJcmfHBhV8y4uBgQN6W8 oWThj8FzwiZcEhzb7xbVXFyic9LJSOguGSwpwyRMmE8YF7gCF9XhtEr/rauRG5tiNbbbXb mpr4cvqCsO5Q/tqEuuqEgX1zXGDAJtpftgX74MXAb/emIMoLIjr7GN/N27/+Pg== 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 4Pj4jp34qtzcB1; Thu, 23 Mar 2023 12:42:22 +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 32NCgMug012407; Thu, 23 Mar 2023 12:42:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32NCgMJt012406; Thu, 23 Mar 2023 12:42:22 GMT (envelope-from git) Date: Thu, 23 Mar 2023 12:42:22 GMT Message-Id: <202303231242.32NCgMJt012406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 66f3ac8c661d - stable/13 - gvinum: correct assertions 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 66f3ac8c661df02cf7d9e187ea20e66e2e71ec82 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=66f3ac8c661df02cf7d9e187ea20e66e2e71ec82 commit 66f3ac8c661df02cf7d9e187ea20e66e2e71ec82 Author: Ed Maste AuthorDate: 2022-12-12 17:08:39 +0000 Commit: Ed Maste CommitDate: 2023-03-23 12:41:35 +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 (cherry picked from commit 87bb53cb538059a3085db1fa4295dde5fcba55fe) --- 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 3e5b2e3d51a3..f3895f5b80ff 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 2778646467e2..1c30834ec298 100644 --- a/sys/geom/vinum/geom_vinum_raid5.c +++ b/sys/geom/vinum/geom_vinum_raid5.c @@ -605,7 +605,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)); @@ -613,7 +613,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)