]> granicus.if.org Git - zfs/commit
OpenZFS 8056 - zfs send size estimate is inaccurate for some zvols
authorPaul Dagnelie <pcd@delphix.com>
Thu, 7 Jul 2016 22:00:51 +0000 (15:00 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 9 Jun 2017 16:46:14 +0000 (09:46 -0700)
commitdd429b46b7b8990f48c0276abe8080f626f415cb
treeff4a2ac430e73ee8e93b5645179e428971d96ddf
parent38240ebd7a35269e8ce74dc133b34120d707cd6f
OpenZFS 8056 - zfs send size estimate is inaccurate for some zvols

Authored by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: Kash Pande <kash@tripleback.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>
The send size estimate for a zvol can be too low, if the size of the
record headers (dmu_replay_record_t's) is a significant portion of the
size. This is typically the case when the data is highly compressible,
especially with embedded blocks.

The problem is that dmu_adjust_send_estimate_for_indirects() assumes
that blocks are the size of the "recordsize" property (128KB). However,
for zvols, the blocks are the size of the "volblocksize" property (8KB).
Therefore, we estimate that there will be 16x less record headers than
there really will be.

The fix is to check the type of the object set (whether it is a zvol or
not) and pick the appropriate property. In addition, while we are at it,
we also add the size of the BEGIN and END records to the estimate.

OpenZFS-issue: https://www.illumos.org/issues/8056
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/faf09cd
Closes #6205
module/zfs/dmu_send.c