Skip to content

Commit f8866f8

Browse files
Eli Rosenthalbehlendorf
authored andcommitted
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: openzfs/openzfs@c20404ff
1 parent b607405 commit f8866f8

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

module/zfs/dmu_send.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ dump_bytes_cb(void *arg)
107107
dmu_sendarg_t *dsp = dbi->dbi_dsp;
108108
dsl_dataset_t *ds = dmu_objset_ds(dsp->dsa_os);
109109
ssize_t resid; /* have to get resid to get detailed errno */
110+
111+
/*
112+
* The code does not rely on this (len being a multiple of 8). We keep
113+
* this assertion because of the corresponding assertion in
114+
* receive_read(). Keeping this assertion ensures that we do not
115+
* inadvertently break backwards compatibility (causing the assertion
116+
* in receive_read() to trigger on old software).
117+
*
118+
* Removing the assertions could be rolled into a new feature that uses
119+
* data that isn't 8-byte aligned; if the assertions were removed, a
120+
* feature flag would have to be added.
121+
*/
122+
110123
ASSERT0(dbi->dbi_len % 8);
111124

112125
dsp->dsa_err = vn_rdwr(UIO_WRITE, dsp->dsa_vp,
@@ -1806,7 +1819,10 @@ receive_read(struct receive_arg *ra, int len, void *buf)
18061819
{
18071820
int done = 0;
18081821

1809-
/* some things will require 8-byte alignment, so everything must */
1822+
/*
1823+
* The code doesn't rely on this (lengths being multiples of 8). See
1824+
* comment in dump_bytes.
1825+
*/
18101826
ASSERT0(len % 8);
18111827

18121828
while (done < len) {

0 commit comments

Comments
 (0)