Skip to content

Commit 02c5aa9

Browse files
authored
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
1 parent 8865dfb commit 02c5aa9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

module/zfs/dbuf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,6 +2853,7 @@ dmu_buf_fill_done(dmu_buf_t *dbuf, dmu_tx_t *tx, boolean_t failed)
28532853
failed = B_FALSE;
28542854
} else if (failed) {
28552855
VERIFY(!dbuf_undirty(db, tx));
2856+
arc_buf_destroy(db->db_buf, db);
28562857
db->db_buf = NULL;
28572858
dbuf_clear_data(db);
28582859
DTRACE_SET_STATE(db, "fill failed");

0 commit comments

Comments
 (0)