mirror_zfs/cmd
Tim Chase d2c8103a68 Fix problems receiving reallocated dnodes
This is a port of 047116ac - Raw sends must be able to decrease nlevels,
to the zfs-0.7-stable branch.  It includes the various fixes to the
problem of receiving incremental streams which include reallocated dnodes
in which the number of dnode slots has changed but excludes the parts
which are related to raw streams.

From 047116ac:

    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.

This also includes a one-liner fix from loli10K to fix a test failure:
https://github.com/zfsonlinux/zfs/pull/7792#discussion_r212769264

Authored-by: Tom Caputi <tcaputi@datto.com>
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>
Signed-off-by: Tim Chase <tim@chase2k.com>
Ported-by: Tim Chase <tim@chase2k.com>

Closes #6821
Closes #6864

NOTE: This is the first of the port of 3 related patches patches to the
zfs-0.7-release branch of ZoL.  The other two patches should immediately
follow this one.
2018-07-06 02:46:51 -07:00
..
arc_summary Handle broken pipes in arc_summary 2018-01-30 10:27:31 -06:00
arcstat Fix arcstat.py handling of unsupported options 2018-07-06 02:46:51 -07:00
dbufstat Fix some typos 2018-03-14 16:10:38 -07:00
fsck_zfs Add /sbin/fsck.zfs helper 2013-01-09 16:54:58 -08:00
mount_zfs Add MS_MANDLOCK mount failure message 2017-06-07 10:59:44 -07:00
raidz_test Add missing *_destroy/*_fini calls 2017-05-04 19:26:28 -04:00
vdev_id vdev_id: implement slot numbering by port id 2017-08-21 16:41:22 -07:00
zdb Fix zdb -ed on objset for exported pool 2018-03-14 16:10:37 -07:00
zed Allow to limit zed's syslog chattiness 2018-05-07 17:19:56 -07:00
zfs Don't modify argv[] in user tools 2018-07-06 02:46:51 -07:00
zgenhostid Add zgenhostid utility script 2017-07-25 13:22:03 -04:00
zhack zhack: fix getopt return type 2018-01-30 10:27:31 -06:00
zinject Inject zinject(8) a percentage amount of dev errs 2017-06-16 17:21:11 -07:00
zpios Fedora 28: Fix misc bounds check compiler warnings 2018-05-07 17:19:57 -07:00
zpool Don't modify argv[] in user tools 2018-07-06 02:46:51 -07:00
zstreamdump Some additional send stream validity checking 2017-07-25 18:52:40 -07:00
ztest Fix problems receiving reallocated dnodes 2018-07-06 02:46:51 -07:00
zvol_id Fedora 28: Fix misc bounds check compiler warnings 2018-05-07 17:19:57 -07:00
Makefile.am Add zgenhostid utility script 2017-07-25 13:22:03 -04:00