Improve block cloning transactions accounting

Previous dmu_tx_count_clone() was broken, stating that cloning is
similar to free.  While they might be from some points, cloning
is not net-free.  It will likely consume space and memory, and
unlike free it will do it no matter whether the destination has
the blocks or not (usually not, so previous code did nothing).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #17431
This commit is contained in:
Alexander Motin
2025-06-11 14:59:16 -04:00
committed by GitHub
parent 66ec7fb269
commit e0ef4d2768
5 changed files with 45 additions and 13 deletions
+2 -1
View File
@@ -3901,7 +3901,8 @@ dbuf_hold_impl(dnode_t *dn, uint8_t level, uint64_t blkid,
ASSERT(blkid != DMU_BONUS_BLKID);
ASSERT(RW_LOCK_HELD(&dn->dn_struct_rwlock));
ASSERT3U(dn->dn_nlevels, >, level);
if (!fail_sparse)
ASSERT3U(dn->dn_nlevels, >, level);
*dbp = NULL;