Skip to content

Commit c71fe71

Browse files
authored
Fix data corruption when cloning embedded blocks
Don't overwrite blk_phys_birth, as for embedded blocks it is part of the payload. Reviewed-by: Richard Yao <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pawel Jakub Dawidek <[email protected]> Issue #13392 Closes #14739
1 parent 6e01593 commit c71fe71

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

module/zfs/dmu.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,8 +2312,10 @@ dmu_brt_clone(objset_t *os, uint64_t object, uint64_t offset, uint64_t length,
23122312
dl->dr_overridden_by.blk_phys_birth = 0;
23132313
} else {
23142314
dl->dr_overridden_by.blk_birth = dr->dr_txg;
2315-
dl->dr_overridden_by.blk_phys_birth =
2316-
BP_PHYSICAL_BIRTH(bp);
2315+
if (!BP_IS_EMBEDDED(bp)) {
2316+
dl->dr_overridden_by.blk_phys_birth =
2317+
BP_PHYSICAL_BIRTH(bp);
2318+
}
23172319
}
23182320

23192321
mutex_exit(&db->db_mtx);

0 commit comments

Comments
 (0)