Skip to content

Commit

Permalink
Fix data corruption when cloning embedded blocks
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pjd authored Apr 12, 2023
1 parent 6e01593 commit c71fe71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions module/zfs/dmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2312,8 +2312,10 @@ dmu_brt_clone(objset_t *os, uint64_t object, uint64_t offset, uint64_t length,
dl->dr_overridden_by.blk_phys_birth = 0;
} else {
dl->dr_overridden_by.blk_birth = dr->dr_txg;
dl->dr_overridden_by.blk_phys_birth =
BP_PHYSICAL_BIRTH(bp);
if (!BP_IS_EMBEDDED(bp)) {
dl->dr_overridden_by.blk_phys_birth =
BP_PHYSICAL_BIRTH(bp);
}
}

mutex_exit(&db->db_mtx);
Expand Down

0 comments on commit c71fe71

Please sign in to comment.