Skip to content

Commit

Permalink
Fix false assertion in dmu_tx_dirty_buf() on cloning
Browse files Browse the repository at this point in the history
Same as writes block cloning can increase block size and number of
indirection levels.  That means it can dirty block 0 at level 0 or
at new top indirection level without explicitly holding them.

Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
  • Loading branch information
amotin authored and ixhamza committed Dec 2, 2024
1 parent f29dcc2 commit f4d9e06
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions module/zfs/dmu_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,14 @@ dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_impl_t *db)
case THT_CLONE:
if (blkid >= beginblk && blkid <= endblk)
match_offset = TRUE;
/*
* They might have to increase nlevels,
* thus dirtying the new TLIBs. Or the
* might have to change the block size,
* thus dirying the new lvl=0 blk=0.
*/
if (blkid == 0)
match_offset = TRUE;
break;
default:
cmn_err(CE_PANIC, "bad txh_type %d",
Expand Down

0 comments on commit f4d9e06

Please sign in to comment.