]> granicus.if.org Git - zfs/commit
Fix handling of maxblkid for raw sends
authorTom Caputi <tcaputi@datto.com>
Wed, 13 Mar 2019 17:52:01 +0000 (13:52 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 13 Mar 2019 17:52:01 +0000 (10:52 -0700)
commit369aa501d11f4d21d4732b58d749259ad811a10a
tree747a00e61b8ae4348cccaa0cd234b39383898f57
parent146bdc414c7ad5b93417569bff6737d57860ff14
Fix handling of maxblkid for raw sends

Currently, the receive code can create an unreadable dataset from
a correct raw send stream. This is because it is currently
impossible to set maxblkid to a lower value without freeing the
associated object. This means truncating files on the send side
to a non-0 size could result in corruption. This patch solves this
issue by adding a new 'force' flag to dnode_new_blkid() which will
allow the raw receive code to force the DMU to accept the provided
maxblkid even if it is a lower value than the existing one.

For testing purposes the send_encrypted_files.ksh test has been
extended to include a variety of truncated files and multiple
snapshots. It also now leverages the xattrtest command to help
ensure raw receives correctly handle xattrs.

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8168
Closes #8487
include/sys/dmu.h
include/sys/dnode.h
module/zfs/dbuf.c
module/zfs/dmu.c
module/zfs/dmu_recv.c
module/zfs/dnode.c
module/zfs/dnode_sync.c
module/zfs/dsl_crypt.c
tests/zfs-tests/cmd/xattrtest/xattrtest.c
tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh