freebsd-dev/sys
Alexander Motin a151f3a7ef MFV r296609: 6370 ZFS send fails to transmit some holes
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Stefan Ring <stefanrin@gmail.com>
Reviewed by: Steven Burgess <sburgess@datto.com>
Reviewed by: Arne Jansen <sensille@gmx.net>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

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 (and thus can not 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).

Closes #37

openzfs/openzfs@adef853162
2016-03-10 09:01:19 +00:00
..
amd64 Fix reporting of the CloudABI ABI in kdump. 2016-03-09 18:38:30 +00:00
arm Add SMP support for the Allwinner A31 and A31s. This updated the existing 2016-03-06 11:41:08 +00:00
arm64 Fix reporting of the CloudABI ABI in kdump. 2016-03-09 18:38:30 +00:00
boot Improve U-Boot API detection 2016-03-09 11:45:48 +00:00
bsm Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: 2015-12-20 23:22:04 +00:00
cam Move to new value for XPT_GET_SIM_KNOB to avoid clash with XPT_ATA_IO. 2016-03-10 06:25:05 +00:00
cddl MFV r296609: 6370 ZFS send fails to transmit some holes 2016-03-10 09:01:19 +00:00
compat Regen. 2016-03-09 19:06:46 +00:00
conf Add MIPS_INTRNG to sys/conf/options.mips 2016-03-08 08:57:53 +00:00
contrib Remove redundant NULL pointer comparison. 2016-03-02 03:28:57 +00:00
crypto Break up opencrypto/xform.c so it can be reused piecemeal 2015-12-30 22:43:07 +00:00
ddb Add helper to catch single step debug event and distinguish it from bkpt 2015-11-27 19:03:59 +00:00
dev Move to new value for XPT_GET_SIM_KNOB to avoid clash with XPT_ATA_IO. 2016-03-10 06:25:05 +00:00
fs Pass MNTK_NO_IOPF and MNTK_UNMAPPED_BUFS flags from the lower 2016-03-04 17:24:28 +00:00
gdb
geom Don't assume that bio_cmd is a bit mask. 2016-03-10 06:25:39 +00:00
gnu Update our copy of the Linux dts files to be in sync with Linux 4.5-rc1. We 2016-02-09 16:42:32 +00:00
i386 Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere(). 2016-02-27 03:38:01 +00:00
isa Replace all resource occurrences of '0UL/~0UL' with '0/~0'. 2016-03-03 05:07:35 +00:00
kern Regen. 2016-03-09 19:06:46 +00:00
kgssapi kcrypto_aes: Use separate sessions for AES and SHA1 2016-02-02 00:14:51 +00:00
libkern
mips Don't assume that bio_cmd is a bitfield. 2016-03-10 06:25:47 +00:00
modules For the MD_ROOT option don't inject /dev/md0 as root dev when ROOTDEVNAME 2016-03-09 19:36:25 +00:00
net buf_ring/drbr: Add buf_ring_peek_clear_sc and use it in drbr_peek 2016-02-29 03:54:51 +00:00
net80211 net80211: fix possible overflow in IEEE80211_TU_TO_TICKS() 2016-03-04 21:22:11 +00:00
netgraph Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere(). 2016-02-27 03:38:01 +00:00
netinet Actually send a asconf chunk, not only queue one. 2016-03-10 00:27:10 +00:00
netinet6 New way to manage reference counting of mbuf external storage. 2016-03-01 00:17:14 +00:00
netipsec Set tres to NULL to avoid a double free if the m_pullup() below fails. 2016-03-02 05:04:04 +00:00
netnatm
netpfil Use correct size for malloc. 2016-03-03 13:07:59 +00:00
netsmb The problem report was for a crash that happened when smbfs was 2015-11-18 23:04:01 +00:00
nfs MFP r287070,r287073: split radix implementation and route table structure. 2016-01-25 06:33:15 +00:00
nfsclient
nfsserver
nlm
ofed Whitespace fixes. 2016-03-04 09:07:30 +00:00
opencrypto Break up opencrypto/xform.c so it can be reused piecemeal 2015-12-30 22:43:07 +00:00
pc98 Another convert to bus_alloc_resource_anywhere(). 2016-03-03 01:09:00 +00:00
powerpc Let rman_init() initialize the default rman range. 2016-03-03 01:12:13 +00:00
riscv Make the fdt_get_mem_regions memsize argument optional. It's only used in 2016-03-01 09:45:27 +00:00
rpc These files were getting sys/malloc.h and vm/uma.h with header pollution 2016-02-01 17:41:21 +00:00
security Busy the mount point which is the owner of the audit vnode, around 2016-01-16 10:06:33 +00:00
sparc64 Correct the memory rman ranges to be to BUS_SPACE_MAXADDR 2016-03-01 02:59:06 +00:00
sys Add raw RX-50 support. These are 400k single sided disks with 80 2016-03-10 00:36:38 +00:00
teken
tests
tools Fix MFS builds when both MD_ROOT_SIZE and MFS_IMAGE are specified 2016-02-02 07:02:51 +00:00
ufs The UFS filesystem requires that the last block of a file always be 2016-02-24 01:58:40 +00:00
vm Remove UMA_ZONE_REFCNT feature, now unused. 2016-03-01 00:33:32 +00:00
x86 Replace all resource occurrences of '0UL/~0UL' with '0/~0'. 2016-03-03 05:07:35 +00:00
xdr
xen xenbus: add a comment with the names of the generated accessors 2016-01-15 14:34:31 +00:00
Makefile Add riscv to the list of architectures for cscope. 2016-02-29 16:39:27 +00:00