]> git.proxmox.com Git - mirror_zfs.git/commit
Fix issue in receive_object() during reallocation
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 12 Apr 2019 21:28:04 +0000 (14:28 -0700)
committerGitHub <noreply@github.com>
Fri, 12 Apr 2019 21:28:04 +0000 (14:28 -0700)
commitb92f5d9f8254f726298a6ab962719fc2b68350b1
tree385746b3edf259ca9edc315f8d78739c24cdb894
parent3fa93bb8d3f0c757814b96a98ce3334d132894f1
Fix issue in receive_object() during reallocation

When receiving an object to a previously allocated interior slot
the new object should be "allocated" by setting DMU_NEW_OBJECT,
not "reallocated" with dnode_reallocate().  For resilience verify
the slot is free as required in case the stream is malformed.

Add a test case to generate more realistic incremental send streams
that force reallocation to occur during the receive.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8067
Closes #8614
module/zfs/dmu_recv.c
tests/runfiles/linux.run
tests/zfs-tests/tests/functional/rsend/Makefile.am
tests/zfs-tests/tests/functional/rsend/rsend.kshlib
tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh
tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh
tests/zfs-tests/tests/functional/rsend/send_realloc_files.ksh [new file with mode: 0755]