From nobody Thu Mar 23 12:50:31 2023 X-Original-To: dev-commits-src-branches@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 4Pj4vD1FMdz41Jlh; Thu, 23 Mar 2023 12:50:32 +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 4Pj4vC727Dz4Mn5; Thu, 23 Mar 2023 12:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679575832; 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=reMVN6/VrR11FFGWw9amkPg/r+Jq8Aw3VX1kLz9r67Q=; b=fvrcHdgFLDA1S3/dqOgfMOrecyOARqpup/wR6SiX0LK+iV5FALCKbFVjr5kvLM+SdZ4h83 7w9xTFqz92Dd5o4tsbLlRaEUQGfOLFMHkT+WCtCQ8rAsygpErz4ffYoCmnoeB6IhpvZ6rE xDNstOFXGZ53CXoKOR50RBhSkXr1yliZPC8VTeo+olFyT7Or6gHg8WYCAGlQbrpzfXC/Rk suWqyC1kfD822EaoCDfd5ci54ekx5LtRGd54GfqAiTuv5MotXSosSB8HtMEqg86iGDmoZo r6/qxs1HC01Z90y8Pl46cKjeAiwXtsKaFkSHcSWpOsA7vklIfhYFqvKLcK71dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679575832; 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=reMVN6/VrR11FFGWw9amkPg/r+Jq8Aw3VX1kLz9r67Q=; b=MGafbD/gwaGj+eFCdtE7VOdPqAFX7bEJthFlVZck0fJVT6btHA8QOAwG5GAcSGuzYORxP3 +EaSaWS239PHjPBqBv0gbkptdJu9mrmatlIGIWX84V1/l4F1JQPUitSEUxQSKWd9QEF8sM NoVIUzojFpNh6fXo52iLD2kPUb4wydpOD0WQXmVlcNiIRYB4+5QHJNeX6m0pZnpdwK+0Zk wxRc0s14b6+x20aj211tMlE6fg8u64qiqbWSqDuZvWSI23SsFbw96RC9KYvLUpQnpayONQ ia1DByrJLK1GVrS3EHBRdmhy3kwHDpjBwMNUYCGpJIn3dQY08qjiCsaEyTyz8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679575832; a=rsa-sha256; cv=none; b=LAomWsOiOLnVrd+YTg2rUBtE5bim0gHeYqzY4+iDg5/pDxbVjaKDJGZ/kIzRWVxGpjylLK DUESvP3GzXf80kcAC7Ff4krUMRH02bAMSfAO6lXHH2rGR66/UDOc6sNMj0KUNhQg10MD43 piZ4ETVkvpa9KE1h7BhvmaqF5tMcHeeS+bna+u8YpI0j8/R5qOC6515h25OD6ieGl1TQRi ftLRZ6ENXY+23JGW6aVc97K7BzxJH9TJlp3w4qccUIUD/oj+5H9VilN8Y4YWNW/16+shuT Tbx26GTxUsPQ2faGn1+y9g4F+PYPXrX0xmD1iBpqx62HyGGBeRoNwwVyfiOJNg== 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 4Pj4vC61WXzc8w; Thu, 23 Mar 2023 12:50:31 +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 32NCoVts022974; Thu, 23 Mar 2023 12:50:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32NCoVx6022973; Thu, 23 Mar 2023 12:50:31 GMT (envelope-from git) Date: Thu, 23 Mar 2023 12:50:31 GMT Message-Id: <202303231250.32NCoVx6022973@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: 12be1c744e00 - stable/12 - gvinum: correct assertions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/12 X-Git-Reftype: branch X-Git-Commit: 12be1c744e002b96c3b84e816e8ec72455f443bf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=12be1c744e002b96c3b84e816e8ec72455f443bf commit 12be1c744e002b96c3b84e816e8ec72455f443bf Author: Ed Maste AuthorDate: 2022-12-12 17:08:39 +0000 Commit: Ed Maste CommitDate: 2023-03-23 12:49:43 +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) (cherry picked from commit 66f3ac8c661df02cf7d9e187ea20e66e2e71ec82) --- 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 4afdb282b821..fc24938bd372 100644 --- a/sys/geom/vinum/geom_vinum_plex.c +++ b/sys/geom/vinum/geom_vinum_plex.c @@ -172,7 +172,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 c21e28ac6a72..0655890e2416 100644 --- a/sys/geom/vinum/geom_vinum_raid5.c +++ b/sys/geom/vinum/geom_vinum_raid5.c @@ -604,7 +604,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)); @@ -612,7 +612,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)