aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <[email protected]>2023-04-13 08:15:05 +0900
committerGitHub <[email protected]>2023-04-12 16:15:05 -0700
commitc71fe716401f6919068f84b389dcd1b7ec2b8b0e (patch)
tree8f22ad19bad969bcf8059215cf18c6bea635cfd4
parent6e015933f88fe7ba5de45cf263028de1ee04460a (diff)
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
-rw-r--r--module/zfs/dmu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index ce985d833..cda1472a7 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -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);