]> granicus.if.org Git - zfs/commit
Raw sends must be able to decrease nlevels
authorTom Caputi <tcaputi@datto.com>
Fri, 19 Jan 2018 09:19:47 +0000 (04:19 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 2 Feb 2018 19:43:11 +0000 (11:43 -0800)
commit047116ac76526d869e3f347afb5d81cc2b156fdf
tree8307d677ee02803b9341d3a7536e27cc71910194
parentd53bd7f5244a1cd0009d2f90d3ec9df22352fbb3
Raw sends must be able to decrease nlevels

Currently, when a raw zfs send file includes a DRR_OBJECT record
that would decrease the number of levels of an existing object,
the object is reallocated with dmu_object_reclaim() which
creates the new dnode using the old object's nlevels. For non-raw
sends this doesn't really matter, but raw sends require that
nlevels on the receive side match that of the send side so that
the checksum-of-MAC tree can be properly maintained. This patch
corrects the issue by freeing the object completely before
allocating it again in this case.

This patch also corrects several issues with dnode_hold_impl()
and related functions that prevented dnodes (particularly
multi-slot dnodes) from being reallocated properly due to
the fact that existing dnodes were not being fully cleaned up
when they were freed.

This patch adds a test to make sure that zfs recv functions
properly with incremental streams containing dnodes of different
sizes.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6821
Closes #6864
cmd/ztest/ztest.c
include/sys/dnode.h
module/zfs/dmu_object.c
module/zfs/dmu_send.c
module/zfs/dnode.c
module/zfs/dnode_sync.c
tests/runfiles/linux.run
tests/zfs-tests/tests/functional/rsend/Makefile.am
tests/zfs-tests/tests/functional/rsend/send_realloc_dnode_size.ksh [new file with mode: 0755]