The branch releng/14.1 has been updated by gordon:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f566b7eb8d94bdde7ad9ddf9bdc9cf336678c386

commit f566b7eb8d94bdde7ad9ddf9bdc9cf336678c386
Author:     Alexander Motin <[email protected]>
AuthorDate: 2024-05-25 02:11:18 +0000
Commit:     Gordon Tetlow <[email protected]>
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 <[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
    
    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");

Reply via email to