aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorEli Rosenthal <[email protected]>2016-06-09 12:07:01 -0700
committerBrian Behlendorf <[email protected]>2016-06-28 13:47:03 -0700
commitf8866f8ae3ad987e8ef4a68ea0066639b5f69bcd (patch)
treed6678973fe3a509c59bbb25235536792a555de3d /module
parentb607405fea86c1cbeb6d1f27d919b315f35d27c9 (diff)
OpenZFS 6738 - zfs send stream padding needs documentation
Authored by: Eli Rosenthal <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed by: Dan McDonald <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/6738 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c20404ff
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dmu_send.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c
index 1c7b53269..2f4087a67 100644
--- a/module/zfs/dmu_send.c
+++ b/module/zfs/dmu_send.c
@@ -107,6 +107,19 @@ dump_bytes_cb(void *arg)
dmu_sendarg_t *dsp = dbi->dbi_dsp;
dsl_dataset_t *ds = dmu_objset_ds(dsp->dsa_os);
ssize_t resid; /* have to get resid to get detailed errno */
+
+ /*
+ * The code does not rely on this (len being a multiple of 8). We keep
+ * this assertion because of the corresponding assertion in
+ * receive_read(). Keeping this assertion ensures that we do not
+ * inadvertently break backwards compatibility (causing the assertion
+ * in receive_read() to trigger on old software).
+ *
+ * Removing the assertions could be rolled into a new feature that uses
+ * data that isn't 8-byte aligned; if the assertions were removed, a
+ * feature flag would have to be added.
+ */
+
ASSERT0(dbi->dbi_len % 8);
dsp->dsa_err = vn_rdwr(UIO_WRITE, dsp->dsa_vp,
@@ -1806,7 +1819,10 @@ receive_read(struct receive_arg *ra, int len, void *buf)
{
int done = 0;
- /* some things will require 8-byte alignment, so everything must */
+ /*
+ * The code doesn't rely on this (lengths being multiples of 8). See
+ * comment in dump_bytes.
+ */
ASSERT0(len % 8);
while (done < len) {