HomeFreeBSD

Raw sends must be able to decrease nlevels

Description

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

Details

Provenance
Tom Caputi <tcaputi@datto.com>Authored on Jan 19 2018, 9:19 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Feb 2 2018, 7:43 PM
Parents
rGd53bd7f5244a: Fix recovery import (-F) with encrypted pool
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG047116ac7652: Raw sends must be able to decrease nlevels (authored by Tom Caputi <tcaputi@datto.com>).Feb 2 2018, 7:43 PM