Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Sep 2016 10:10:59 +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: r305334 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Message-ID:  <201609031010.u83AAxEu098185@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Sep  3 10:10:58 2016
New Revision: 305334
URL: https://svnweb.freebsd.org/changeset/base/305334

Log:
  MFV r304157:
  7230 add assertions to dmu_send_impl() to verify that stream includes BEGIN and END records
  
  illumos/illumos-gate@12b90ee2d3b10689fc45f4930d2392f5fe1d9cfa
  https://github.com/illumos/illumos-gate/commit/12b90ee2d3b10689fc45f4930d2392f5f
  e1d9cfa
  
  https://www.illumos.org/issues/7230
    A test failure occurred where a send stream had only a BEGIN record. This
    should not be possible if the send returns without error. Prevented this from
    happening in the future by adding an assertion to dmu_send_impl() to verify
    that if the function returns 0 (success) both a BEGIN and END record are
    present. Did this by adding flags to dmu_sendarg_t (indicating whether BEGIN o
  r
    END records sent), having dump_record() set flags appropriately, adding VERIFY
    statement to dmu_send_impl().
  
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Reviewed by: Paul Dagnelie <pcd@delphix.com>
  Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
  Approved by: Robert Mustacchi <rm@joyent.com>
  Author: Matt Krantz <matt.krantz@delphix.com>

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h
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 Sep  3 10:09:23 2016	(r305333)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Sat Sep  3 10:10:58 2016	(r305334)
@@ -160,11 +160,16 @@ dump_record(dmu_sendarg_t *dsp, void *pa
 	fletcher_4_incremental_native(dsp->dsa_drr,
 	    offsetof(dmu_replay_record_t, drr_u.drr_checksum.drr_checksum),
 	    &dsp->dsa_zc);
-	if (dsp->dsa_drr->drr_type != DRR_BEGIN) {
+	if (dsp->dsa_drr->drr_type == DRR_BEGIN) {
+		dsp->dsa_sent_begin = B_TRUE;
+	} else {
 		ASSERT(ZIO_CHECKSUM_IS_ZERO(&dsp->dsa_drr->drr_u.
 		    drr_checksum.drr_checksum));
 		dsp->dsa_drr->drr_u.drr_checksum.drr_checksum = dsp->dsa_zc;
 	}
+	if (dsp->dsa_drr->drr_type == DRR_END) {
+		dsp->dsa_sent_end = B_TRUE;
+	}
 	fletcher_4_incremental_native(&dsp->dsa_drr->
 	    drr_u.drr_checksum.drr_checksum,
 	    sizeof (zio_cksum_t), &dsp->dsa_zc);
@@ -912,6 +917,8 @@ out:
 	list_remove(&to_ds->ds_sendstreams, dsp);
 	mutex_exit(&to_ds->ds_sendstream_lock);
 
+	VERIFY(err != 0 || (dsp->dsa_sent_begin && dsp->dsa_sent_end));
+
 	kmem_free(drr, sizeof (dmu_replay_record_t));
 	kmem_free(dsp, sizeof (dmu_sendarg_t));
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h	Sat Sep  3 10:09:23 2016	(r305333)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h	Sat Sep  3 10:10:58 2016	(r305334)
@@ -301,6 +301,8 @@ typedef struct dmu_sendarg {
 	uint64_t dsa_last_data_offset;
 	uint64_t dsa_resume_object;
 	uint64_t dsa_resume_offset;
+	boolean_t dsa_sent_begin;
+	boolean_t dsa_sent_end;
 } dmu_sendarg_t;
 
 void dmu_object_zapify(objset_t *, uint64_t, dmu_object_type_t, dmu_tx_t *);



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