From owner-svn-src-vendor@freebsd.org Sat Apr 2 08:25:42 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D1B7B00C1E; Sat, 2 Apr 2016 08:25:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 236711E77; Sat, 2 Apr 2016 08:25:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u328Pf9S005927; Sat, 2 Apr 2016 08:25:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u328PfPu005926; Sat, 2 Apr 2016 08:25:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604020825.u328PfPu005926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 2 Apr 2016 08:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r297506 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 08:25:42 -0000 Author: mav Date: Sat Apr 2 08:25:41 2016 New Revision: 297506 URL: https://svnweb.freebsd.org/changeset/base/297506 Log: 6738 zfs send stream padding needs documentation Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Paul Dagnelie Reviewed by: Dan McDonald Approved by: Robert Mustacchi Author: Eli Rosenthal illumos/illumos-gate@c20404ff77119516354b0d112d28b7ea0dadd303 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Sat Apr 2 08:24:23 2016 (r297505) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Sat Apr 2 08:25:41 2016 (r297506) @@ -96,6 +96,19 @@ dump_bytes(dmu_sendarg_t *dsp, void *buf { 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(len % 8); dsp->dsa_err = vn_rdwr(UIO_WRITE, dsp->dsa_vp, @@ -1758,7 +1771,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) {