From nobody Tue Apr 25 15:21:50 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 4Q5Qhb1XS4z47KKh; Tue, 25 Apr 2023 15:21:51 +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 4Q5Qhb14zsz3hvB; Tue, 25 Apr 2023 15:21:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682436111; 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=KLWd88dNZdExdeq1q0sdqTNEqI5+k9f7bh78XvQ8TJw=; b=mLl5JQkt3zwTZwV0HRA4+9WN/X7X9LnUAcC+KeaiMJFR1VzIU3HFmrhbQ4p93pOYIjaqlB TNoT4xAfIVXEsGYFEZWHTFrLbIv9u8630f3JrnZYyqZmxtTiiprwsizNI5HuuMOtALyuTx BxdC6AWb8N0Qhsw9JBrkwU4eIQlEqzH5JxPdAwErLCPQ1Sx9ev/hxOoNw1MAZxJ3w1emtF bxuGaE5zX+8b1nmZVP0o27OwPGbjM819V2qoC5riKnNCQ0w5HC1qrAiDtJ50zs68pM4OXS yYqxYuSi7AzIeqOsbTPpB3lZ3/U4pF81o38VrOxdxlyjxLQuWfBCfuwYIT8UHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682436111; 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=KLWd88dNZdExdeq1q0sdqTNEqI5+k9f7bh78XvQ8TJw=; b=R0Z3lEF2x3nVlMLfoIHyRcbzoR8KTdBTI+jSVDJ6B8G2qa/nTUm3XMhxkBte+ZaTKkEyUT oBH6cNmlv7IILIHNjsLq07UTL1LEPjf0WSz/YwMaX2EzHb4ugPEAuyw2DEQZ8mTgXeqAE0 L/vfvv+1CsLVvYmPl6EfLNChbwvZLkjv7hjF/xpjXSf7r88aaDpsIZ2t0PY4zpyNoqTabP 0XgTDQLk8F2HcZOLgyX1Im+MzDJbwpAVNB4qLRJW9hSsrM7ObN0McXuoGOUzbzXPVcynwp eQufOCI4ZUi2SJtkORp0gcwsJa2XW9xjVJcO9DWTkgGBBP5bWzzxfD6MgO3y8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682436111; a=rsa-sha256; cv=none; b=l7jeS3FLOpJHV5PPCc4JlE9g8oa3d2tUqcT+S8f9au3KFaHBGXg8kcb7mwpnm9IIK7AwSo NLoSq9LofsUVTIOfYjstuHs0BOTekVePL3mJY6Ah3IxGbTnOaZX58O6U6V3GX0ZgKfr5eo qx004LJghgIlYQfPH90mornl8dq9+nB7UAA0Gf8rCPinlPQ4RczU1gjTwUrVkT8LeaWh2E muP5F2hhSc6+mJAN900X9iYHj5I0nZSh9vh2pYbV3SY+CkgIKuTP4KSWOKOaUH5hyiSWpT POjpgg2wyKiEwh1YxIn/ibSW4SK0isPGvSUwziLDhFFeQbZJC25VKXmjjLlFZw== 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 4Q5Qhb07csz1CDr; Tue, 25 Apr 2023 15:21:51 +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 33PFLovr025530; Tue, 25 Apr 2023 15:21:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33PFLous025529; Tue, 25 Apr 2023 15:21:50 GMT (envelope-from git) Date: Tue, 25 Apr 2023 15:21:50 GMT Message-Id: <202304251521.33PFLous025529@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: b4d3dd861511 - main - zfs: fix up bogus checksums with blake3 in face of cpu migration 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4d3dd861511cc58c1d1328511189b8a42a6d091 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b4d3dd861511cc58c1d1328511189b8a42a6d091 commit b4d3dd861511cc58c1d1328511189b8a42a6d091 Author: Mateusz Guzik AuthorDate: 2023-04-25 15:20:19 +0000 Commit: Mateusz Guzik CommitDate: 2023-04-25 15:20:19 +0000 zfs: fix up bogus checksums with blake3 in face of cpu migration This is a temporary measure until a better fix is sorted out. Upstream report: https://github.com/openzfs/zfs/issues/14785 Reported by: Evgeniy Khramtsov Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/contrib/openzfs/module/zfs/blake3_zfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/blake3_zfs.c b/sys/contrib/openzfs/module/zfs/blake3_zfs.c index bcc595bca8f2..7783282b671a 100644 --- a/sys/contrib/openzfs/module/zfs/blake3_zfs.c +++ b/sys/contrib/openzfs/module/zfs/blake3_zfs.c @@ -50,7 +50,8 @@ abd_checksum_blake3_native(abd_t *abd, uint64_t size, const void *ctx_template, ASSERT(ctx_template != NULL); #if defined(_KERNEL) - BLAKE3_CTX *ctx = blake3_per_cpu_ctx[CPU_SEQID_UNSTABLE]; + kpreempt_disable(); + BLAKE3_CTX *ctx = blake3_per_cpu_ctx[CPU_SEQID]; #else BLAKE3_CTX *ctx = kmem_alloc(sizeof (*ctx), KM_SLEEP); #endif @@ -59,7 +60,9 @@ abd_checksum_blake3_native(abd_t *abd, uint64_t size, const void *ctx_template, (void) abd_iterate_func(abd, 0, size, blake3_incremental, ctx); Blake3_Final(ctx, (uint8_t *)zcp); -#if !defined(_KERNEL) +#if defined(_KERNEL) + kpreempt_enable(); +#else memset(ctx, 0, sizeof (*ctx)); kmem_free(ctx, sizeof (*ctx)); #endif