Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Apr 2016 08:36:25 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r297509 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201604020836.u328aPZY009355@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Apr  2 08:36:24 2016
New Revision: 297509
URL: https://svnweb.freebsd.org/changeset/base/297509

Log:
  MFV r297506: 6738 zfs send stream padding needs documentation
  
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
  Reviewed by: Paul Dagnelie <pcd@delphix.com>
  Reviewed by: Dan McDonald <danmcd@omniti.com>
  Approved by: Robert Mustacchi <rm@joyent.com>
  Author: Eli Rosenthal <eli.rosenthal@delphix.com>
  
  illumos/illumos-gate@c20404ff77119516354b0d112d28b7ea0dadd303

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Sat Apr  2 08:34:15 2016	(r297508)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Sat Apr  2 08:36:24 2016	(r297509)
@@ -107,6 +107,19 @@ dump_bytes(dmu_sendarg_t *dsp, void *buf
 	dsl_dataset_t *ds = dmu_objset_ds(dsp->dsa_os);
 	struct uio auio;
 	struct iovec aiov;
+
+	/*
+	 * 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(len % 8);
 
 	aiov.iov_base = buf;
@@ -1824,7 +1837,10 @@ receive_read(struct receive_arg *ra, int
 {
 	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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604020836.u328aPZY009355>