From 2bba6e3c5440e179a498c5cf551373008f82b4e7 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 11 Nov 2024 08:39:47 -0500 Subject: [PATCH] BRT: Don't call brt_pending_remove() on holes/embedded We are doing exactly the same checks around all brt_pending_add(). Reviewed-by: Brian Behlendorf Reviewed-by: Pawel Jakub Dawidek Reviewed-by: Brian Atkinson Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #16740 --- module/zfs/dbuf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index 35d0e59ee..4dcc271c9 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -2543,8 +2543,11 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx) * We are freeing a block that we cloned in the same * transaction group. */ - brt_pending_remove(dmu_objset_spa(db->db_objset), - &dr->dt.dl.dr_overridden_by, tx); + blkptr_t *bp = &dr->dt.dl.dr_overridden_by; + if (!BP_IS_HOLE(bp) && !BP_IS_EMBEDDED(bp)) { + brt_pending_remove(dmu_objset_spa(db->db_objset), + bp, tx); + } } dnode_t *dn = dr->dr_dnode;