Skip to content

Commit

Permalink
OpenZFS 6738 - zfs send stream padding needs documentation
Browse files Browse the repository at this point in the history
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: openzfs/openzfs@c20404ff
  • Loading branch information
Eli Rosenthal authored and behlendorf committed Jun 28, 2016
1 parent b607405 commit f8866f8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion module/zfs/dmu_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f8866f8

Please sign in to comment.