From nobody Wed Apr 26 18:01:32 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 4Q66BN52jXz4757d; Wed, 26 Apr 2023 18:01: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 4Q66BN4cNqz3xsP; Wed, 26 Apr 2023 18:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682532092; 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=ikwqU+/nWtXV9zlPc17zuUWqucMqWVRmZUYrSrjttjc=; b=URRvtIKE9gbEvJDaGXHd0sPwDVqhy4daJ/w9F0re8iKQ3nKhpiGvWKTGMmtPcVfijSGvFo s9uludrQQU8Jba3ZnT3X8Itl8jSVRAiXcic997+i7NLazINR4/lLfQZH7ACwWqcEtVsnpz Ch3/qlHuUn8f1tX1YdU+ApLuEIWBEB971BGrv4628KucfQRNMdDyt90d5FCbpEZzJ89l/y 7Xyf6bdCw03K9UB6uNhJlKe0tk5vRuwyVlELyEPQHXBzuDo7KtLhDXxdgjacVIK2R9kno/ 9ypufWF++UNdsZnRpmzanZddm/NobI1Fp4gMtTPbewlAJ4P699Lqshth7OJugQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682532092; 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=ikwqU+/nWtXV9zlPc17zuUWqucMqWVRmZUYrSrjttjc=; b=wp62u4U+QJhUwOyuWjxRrjWekHXX+H4m27tcVsfidDZift1DRgPhJj0MLEQHRBxZqYg8UB /B8ISLZM5DO9lNlHK10Ll3ifV/RWaEcpTMI1PtoBmRckaETjVUqBgZRKMKmiZ+SQt4vzYw 7DXGWW83SEfYB5tk8mBP9YML3KQiZEv7QA0ohjRKJNVKGXa/vA3SPPGlTXZwkluAAWDx9Y AcTBNF8uQaVxGvcCsf/sRvWQgBAUTmqSKqhKAWK9afV88y1OSW6IqfrsA9DosHIqdiJZdh 8QCsP2FzU7TIqlZcNAjcKJsbBCEQuwujkgvcpEFFQfLmW53NVmD+myqD/n7X9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682532092; a=rsa-sha256; cv=none; b=hsolrrld/13m0AIkPhex4mv0mxDERHRElBEYqJczFwIqha9WqxaYmGmXExCuvSmeOs2haW 4Iitd2htd4F3flUoqTu4ofBfWm54v7l79T8v83azelWAZz2cD6TZ3OnJM7VqT1hopEh8+i E0WGf0OMSccfr71QUnOAQTfWVhJb7pMeGJelTyc9zKiQzSYBBKFfNrfbdcVTkcSFrl0ErU sjqZR5QcusKVdOgK0G92YKdFKfNpdEiVE37h9xRyqydOQi5c5e2IvzTzrmsH5hSmG0cDIv H8/tBoKo+flpIlCFIie3DhoETP2XSlIg7AtyjF7cYlihiJu9BKpYmlsei8Cexg== 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 4Q66BN3jVjzl1q; Wed, 26 Apr 2023 18:01:32 +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 33QI1WoE063850; Wed, 26 Apr 2023 18:01:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33QI1W4S063849; Wed, 26 Apr 2023 18:01:32 GMT (envelope-from git) Date: Wed, 26 Apr 2023 18:01:32 GMT Message-Id: <202304261801.33QI1W4S063849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: d09a955a605d - main - zfs: Fix positive ABD size assertion in abd_verify(). 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d09a955a605d03471c5ab7bd17b8a6186fdc148c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d09a955a605d03471c5ab7bd17b8a6186fdc148c commit d09a955a605d03471c5ab7bd17b8a6186fdc148c Author: Mateusz Guzik AuthorDate: 2023-04-26 17:59:24 +0000 Commit: Mateusz Guzik CommitDate: 2023-04-26 18:00:36 +0000 zfs: Fix positive ABD size assertion in abd_verify(). This cherry-picks upstream: commit bba7cbf0a481ab16f9a9a4874b7dbd5682e4d3a4 Author: Alexander Motin Date: Wed Apr 26 12:20:43 2023 -0400 Fix positive ABD size assertion in abd_verify(). Gang ABDs without childred are legal, and they do have zero size. For other ABD types zero size doesn't have much sense and likely not working correctly now. Reviewed-by: Igor Kozhukhov Reviewed-by: Brian Behlendorf Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #14795 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/contrib/openzfs/module/zfs/abd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/zfs/abd.c b/sys/contrib/openzfs/module/zfs/abd.c index d4921d0ba7db..26222d2efe3f 100644 --- a/sys/contrib/openzfs/module/zfs/abd.c +++ b/sys/contrib/openzfs/module/zfs/abd.c @@ -109,7 +109,6 @@ void abd_verify(abd_t *abd) { #ifdef ZFS_DEBUG - ASSERT3U(abd->abd_size, >, 0); ASSERT3U(abd->abd_size, <=, SPA_MAXBLOCKSIZE); ASSERT3U(abd->abd_flags, ==, abd->abd_flags & (ABD_FLAG_LINEAR | ABD_FLAG_OWNER | ABD_FLAG_META | ABD_FLAG_MULTI_ZONE | @@ -118,6 +117,7 @@ abd_verify(abd_t *abd) IMPLY(abd->abd_parent != NULL, !(abd->abd_flags & ABD_FLAG_OWNER)); IMPLY(abd->abd_flags & ABD_FLAG_META, abd->abd_flags & ABD_FLAG_OWNER); if (abd_is_linear(abd)) { + ASSERT3U(abd->abd_size, >, 0); ASSERT3P(ABD_LINEAR_BUF(abd), !=, NULL); } else if (abd_is_gang(abd)) { uint_t child_sizes = 0; @@ -130,6 +130,7 @@ abd_verify(abd_t *abd) } ASSERT3U(abd->abd_size, ==, child_sizes); } else { + ASSERT3U(abd->abd_size, >, 0); abd_verify_scatter(abd); } #endif