From nobody Wed Jun 19 20:36:48 2024 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 4W4Flj1FK8z5NnC8; Wed, 19 Jun 2024 20:36:49 +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 4W4Flj0l0Pz4NdL; Wed, 19 Jun 2024 20:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718829409; 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=gKqW6NEP5FII4wKcXobJnk1E/KZo5P8SL2vX56CfOEo=; b=xiHIDGBK6yP/MviJ/kJn1xyKE1edoJddAfVH0nguqhIKr+g6EoC5L342MW1e8o0QCG2tqa jiz9BukO+bAYQEKU1oD86iwogsQCg/1a8vIzJDQux0B7r8vGMmebyJawhYzfArvktzTahC sSuRC3zQcn43AZwLTqAWJ4XrYfaGy7H1J4IompBIKduq/ZpBKOPvEZd9Rk05mPPOpxmlWa 01fdmrtjC7QY5Hq+62Dfky0Zf9Rsi7Yg+nkmC/0dr6v1+PtODrFFArMRBoDGfvym4Jwk2A 90UyxRZ+lYgRn7yJ9xFeQwZHsd/7ZVt+Ny9YK9Krri/9gPaAUhp0Fg6OmLbmWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718829409; a=rsa-sha256; cv=none; b=InHG2UQ4MzWB5FZxY0SwM8ikGjnJUIc/+kIHUjniRlCBIXDqJowPOxKMlzd0uKXqAJP+46 hmtxkBfDvPRW7+OvSXHSO1BtxEoi6W8aKq7A4eDIKYZQ5W37otkO+CAhJSp269sDHBk0eb dPP0C/AAljLUNhu1CUcjVPDwuZRJ28cOeVzxTtgph+Z8WSUZMPuh9iTVl31NXYN27drPmK RCqmDJAELYyU5mqJaGZSHRraIcvX3NfGHMK4KtxuXOhkdIL32MhcZxmOcB9Fz2/eW7rSTt XOwEbw8xMVRD8bZG8SpXyLLr2pHa7eh/2am1n8nRdR4je8UxvhkAU+y4VJGbVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718829409; 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=gKqW6NEP5FII4wKcXobJnk1E/KZo5P8SL2vX56CfOEo=; b=LM9vBQMQ83ENLIFpobX084k8OGUe0G3fbRZwikFzqv+e0Xfc0+TZjSRE5IGHM26U+XCEpN Dorcdpv8jG+EXvJtVK/BNCRaEn7nQKjYZ6YNod2WJK5VFIbS+wGl3zZcmLBjzkvW0WmsUy Fby5ZkrCpX2C/j/9aVi0PKZyhWLM7mTZ9T387hTHwcaxliFi/Mt7agVmuwsKj2VEE99XoH /OGOOdo8qipkuhp5tZoC5zvZMZ/KQr8VYP2T31sbSk2r7E+Yt1CGMbisuF4LesgTHhaD8O ROgm5XHpr4s3uqBIi2MnrhpMwpEE/83DihYxSX8Lbwg48HiiDlpIIZIkkEUxVw== 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 4W4Flj0DTzzx5w; Wed, 19 Jun 2024 20:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45JKamBd001815; Wed, 19 Jun 2024 20:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45JKamEi001812; Wed, 19 Jun 2024 20:36:48 GMT (envelope-from git) Date: Wed, 19 Jun 2024 20:36:48 GMT Message-Id: <202406192036.45JKamEi001812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: f566b7eb8d94 - releng/14.1 - Destroy ARC buffer in case of fill error 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: f566b7eb8d94bdde7ad9ddf9bdc9cf336678c386 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=f566b7eb8d94bdde7ad9ddf9bdc9cf336678c386 commit f566b7eb8d94bdde7ad9ddf9bdc9cf336678c386 Author: Alexander Motin AuthorDate: 2024-05-25 02:11:18 +0000 Commit: Gordon Tetlow CommitDate: 2024-06-18 17:35:52 +0000 Destroy ARC buffer in case of fill error In case of error dmu_buf_fill_done() returns the buffer back into DB_UNCACHED state. Since during transition from DB_UNCACHED into DB_FILL state dbuf_noread() allocates an ARC buffer, we must free it here, otherwise it will be leaked. Reviewed-by: Brian Behlendorf Reviewed-by: Jorgen Lundman Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #15665 Closes #15802 Closes #16216 PR: 276341 Approved by: so Security: FreeBSD-EN-24:10.zfs (cherry picked from commit 02c5aa9b092818785ed8db4e2246a828278138e3) (cherry picked from commit 1c27279ed22d2b5226f31836da041bae45a9c77b) --- sys/contrib/openzfs/module/zfs/dbuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/contrib/openzfs/module/zfs/dbuf.c b/sys/contrib/openzfs/module/zfs/dbuf.c index bb921af6d78a..0576da6475b1 100644 --- a/sys/contrib/openzfs/module/zfs/dbuf.c +++ b/sys/contrib/openzfs/module/zfs/dbuf.c @@ -2840,6 +2840,7 @@ dmu_buf_fill_done(dmu_buf_t *dbuf, dmu_tx_t *tx, boolean_t failed) failed = B_FALSE; } else if (failed) { VERIFY(!dbuf_undirty(db, tx)); + arc_buf_destroy(db->db_buf, db); db->db_buf = NULL; dbuf_clear_data(db); DTRACE_SET_STATE(db, "fill failed");