]> git.proxmox.com Git - mirror_zfs.git/commit
Fix issues with truncated files in raw sends
authorTom Caputi <tcaputi@datto.com>
Wed, 27 Mar 2019 18:30:48 +0000 (14:30 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 27 Mar 2019 18:30:48 +0000 (11:30 -0700)
commit5dbf8b4edd5a60b0d043b09aa168e8be1fb30647
treec669936d8489f78461b70ff64492bba9dcec4224
parent85a150ce1e6d609cec814f9af28ce4f2aef312ab
Fix issues with truncated files in raw sends

This patch fixes a few issues with raw receives involving
truncated files:

* dnode_reallocate() now calls dnode_set_blksz() instead of
  dnode_setdblksz(). This ensures that any remaining dbufs with
  blkid 0 are resized along with their containing dnode upon
  reallocation.

* One of the calls to dmu_free_long_range() in receive_object()
  needs to check that the object it is about to free some contents
  or hasn't been completely removed already by a previous call to
  dmu_free_long_object() in the same function.

* The same call to dmu_free_long_range() in the previous point
  needs to ensure it uses the object's current block size and
  not the new block size. This ensures the blocks of the object
  that are supposed to be freed are completely removed and not
  simply partially zeroed out.

This patch also adds handling for DRR_OBJECT_RANGE records to
dprintf_drr() for debugging purposes.

Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #7378
Closes #8528
module/zfs/dmu.c
module/zfs/dmu_recv.c
module/zfs/dnode.c
tests/runfiles/linux.run
tests/zfs-tests/tests/functional/rsend/Makefile.am
tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh
tests/zfs-tests/tests/functional/rsend/send_encrypted_truncated_files.ksh [new file with mode: 0755]