Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Chris Williamson <[email protected]>

In certain circumstances, "zfs send -i" (incremental send) can produce a
stream which will result in incorrect sparse file contents on the
target.

The problem manifests as regions of the received file that should be
sparse (and read a zero-filled) actually contain data from a file that
was deleted (and which happened to share this file's object ID).

Note: this can happen only with filesystems (not zvols, because they do
not free (or reuse) object IDs).

Note: This can happen only if, since the incremental source (FromSnap),
a file was deleted and then another file was created, and the new file
is sparse (i.e. has areas that were never written to and should be
implicitly zero-filled).

We suspect that this was introduced by 4370 (applies only if hole_birth
feature is enabled), and made worse by 5243 (applies if hole_birth
feature is disabled, and we never send any holes).

The bug is caused by the hole birth feature. When an object is deleted
and replaced, all the holes in the object have birth time zero. However,
zfs send cannot tell that the holes are new since the file was replaced,
so it doesn't send them in an incremental. As a result, you can end up
with invalid data when you receive incremental send streams. As a
short-term fix, we can always send holes with birth time 0 (unless it's
a zvol or a dataset where we can guarantee that no objects have been
reused).
You can view, comment on, or merge this pull request online at:

  https://github.com/openzfs/openzfs/pull/37

-- Commit Summary --

  * 6370 ZFS send fails to transmit some holes

-- File Changes --

    M usr/src/pkg/manifests/system-test-zfstest.mf (2)
    M usr/src/test/zfs-tests/runfiles/delphix.run (3)
    M 
usr/src/test/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_010_pos.ksh
 (5)
    M usr/src/test/zfs-tests/tests/functional/cli_root/zfs_send/Makefile (5)
    A 
usr/src/test/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh 
(95)
    M usr/src/uts/common/fs/zfs/dmu_object.c (8)
    M usr/src/uts/common/fs/zfs/dmu_traverse.c (48)

-- Patch Links --

https://github.com/openzfs/openzfs/pull/37.patch
https://github.com/openzfs/openzfs/pull/37.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/37
_______________________________________________
developer mailing list
[email protected]
http://lists.open-zfs.org/mailman/listinfo/developer

Reply via email to