diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c index 0e9a4dabec50..b7a7f90cf006 100644 --- a/module/zfs/dnode.c +++ b/module/zfs/dnode.c @@ -1106,6 +1106,7 @@ dnode_check_slots_free(dnode_children_t *children, int idx, int slots) } else if (DN_SLOT_IS_PTR(dn)) { mutex_enter(&dn->dn_mtx); boolean_t can_free = (dn->dn_type == DMU_OT_NONE && + zfs_refcount_is_zero(&dn->dn_holds) && !DNODE_IS_DIRTY(dn)); mutex_exit(&dn->dn_mtx);