aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2024-05-24 22:11:18 -0400
committerGitHub <[email protected]>2024-05-24 19:11:18 -0700
commit02c5aa9b092818785ed8db4e2246a828278138e3 (patch)
tree21bbd829d0c989bc65767478b78b54ef871e1110
parent8865dfbcaad44a1056f35be60d3058dd3b1e9145 (diff)
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 <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #15665 Closes #15802 Closes #16216
-rw-r--r--module/zfs/dbuf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
index bce41948c..56fe2c4db 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");