From a1bf16ca699986b6d59ccea30eb6169c89384d39 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Tue, 21 May 2024 21:13:58 -0400 Subject: [PATCH] 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. Fixes: #15665 Closes: #15802 Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. --- module/zfs/dbuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index bce41948c4..56fe2c4dbe 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -2853,6 +2853,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");