The branch main has been updated by pjd: URL: https://cgit.FreeBSD.org/src/commit/?id=e0bb199925565a3770733afd1a4d8bb2d4d0ce31
commit e0bb199925565a3770733afd1a4d8bb2d4d0ce31 Author: Pawel Jakub Dawidek <p...@freebsd.org> AuthorDate: 2023-04-17 09:19:49 +0000 Commit: Pawel Jakub Dawidek <p...@freebsd.org> CommitDate: 2023-04-17 09:19:49 +0000 zfs: cherry-pick openzfs/zfs@c71fe7164 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 <richard....@alumni.stonybrook.edu> Reviewed-by: Brian Behlendorf <behlendo...@llnl.gov> Signed-off-by: Pawel Jakub Dawidek <pa...@dawidek.net> Issue #13392 Closes #14739 Approved by: oshogbo, mm --- sys/contrib/openzfs/module/zfs/dmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/dmu.c b/sys/contrib/openzfs/module/zfs/dmu.c index ce985d833f58..cda1472a77aa 100644 --- a/sys/contrib/openzfs/module/zfs/dmu.c +++ b/sys/contrib/openzfs/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);