From nobody Mon Jun 17 14:35:24 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 4W2sqc6bktz5P0T5; Mon, 17 Jun 2024 14:35:24 +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 4W2sqc63Nqz4vjl; Mon, 17 Jun 2024 14:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718634924; 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=YRuc2yoz7GtCIIF8jQboRKye7IZ89ZUGIAv4tjrbplE=; b=OOP6rZJBzW/ovgiNzOcVHSSrr+WKx24Tza6HM/zpOSD7sB+7z0fOQhNXG4FpKyIooqwy8B M3mus0PA12PeRJ9Mbyf8i5k8PwIimwAv8dsE9LWo9O0i0yaq5BwagfJyjg48O0/R364XT5 KmLJxL/HI6U7cn1FhAHXk44ZKxHW9yIQwnUVw34NvB5zMlzmYAn0Fxnr+xZllpkgncN1js Gh4cP2C3XbQtE/nXEx3tLAqeiCxEJemjLhql8QZp927p+7C2Q5McXDY6i0aUl5T2Z6ZTsF /ZJTmvGvNH5V/e1xAwtZLcvO5cdhCwXge6dPtpd1PNf6JdDd5ZcTnEhUfuAiPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718634924; a=rsa-sha256; cv=none; b=ZSXBitS+qNxxyQXlQJl5CFSnTRrOgZ5Ex9wvJfksBU1kke/4cdcFt28GK/46TTKOTHwnoF O2QFfE4UhS5Pzi6rWkZqdVaSnlKwnEzKCN5dEkSkvYI63aULzevcT3WSLIEealPI9NDkOn BBetxi0SvTuo/+RJrxzEqzlg1rJ6Kg4nuWtet64aPZxEarhJJUs4GIUG8iVUpS/radbMTi QLTNOa49hVcGK+r9AxrgrXlWweEJElCXfZoA6gugXOOAGF+HYnAWOUin8D8Eept9KiTxW8 mTRpGxa0gjcCtfOzjH3J2RtJ4FgLwYn+zOyeD7m2HZkDgp4cGxrnzHgwya3mow== 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=1718634924; 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=YRuc2yoz7GtCIIF8jQboRKye7IZ89ZUGIAv4tjrbplE=; b=xu0vcwTdWRFTbcUAvS/Fi5JkGmE5BuTJS//uXebQMSHJTlbyx6gcMG/G3XJLIoA1Py6A9M bJUheJIdGQS5F/peFWAiCBS5WDe54JxG0NxqpZZFBvi+349c10KBG/bu2hXwiZD3H0fxnL Rfl5VPmkjpp71PpD6OT3c4dhbyRo1Wr0qDguYcLrb9mEBywgO0D/1MNxni/WOLqV1ZPR9p Wj/yxzwp90mjASCCNEC+rqn+dFGi30/3dFq8Wzut4b/0GBBzz97GqjvqRQD97IXqbViT9N qv33VlcPwa2SBoN8IdmK4JQS1HrKZ+t84KAOBmwRAy9MfCK6PhvIBOzH5PsRiQ== 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 4W2sqc5fZ9zKVY; Mon, 17 Jun 2024 14:35:24 +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 45HEZO5w004403; Mon, 17 Jun 2024 14:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45HEZOZj004400; Mon, 17 Jun 2024 14:35:24 GMT (envelope-from git) Date: Mon, 17 Jun 2024 14:35:24 GMT Message-Id: <202406171435.45HEZOZj004400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1c27279ed22d - stable/14 - 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c27279ed22d2b5226f31836da041bae45a9c77b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1c27279ed22d2b5226f31836da041bae45a9c77b commit 1c27279ed22d2b5226f31836da041bae45a9c77b Author: Alexander Motin AuthorDate: 2024-05-25 02:11:18 +0000 Commit: Mark Johnston CommitDate: 2024-06-17 14:25:59 +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 (cherry picked from commit 02c5aa9b092818785ed8db4e2246a828278138e3) --- 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");