svn commit: r316934 - vendor/illumos/dist/lib/libzfs/common

Andriy Gapon avg at FreeBSD.org
Fri Apr 14 18:54:13 UTC 2017


Author: avg
Date: Fri Apr 14 18:54:11 2017
New Revision: 316934
URL: https://svnweb.freebsd.org/changeset/base/316934

Log:
  7340 receive manual origin should override automatic origin
  
  illumos/illumos-gate at ed4e7a6a5cbc5e8986dc649ad54435210487b102
  https://github.com/illumos/illumos-gate/commit/ed4e7a6a5cbc5e8986dc649ad54435210487b102
  
  https://www.illumos.org/issues/7340
    When -o origin=<snapshot> is specified as part of a ZFS receive, that origin
    should override the automatic detection in libzfs.
  
  Reviewed by: George Wilson <george.wilson at delphix.com>
  Reviewed by: Matthew Ahrens <mahrens at delphix.com>
  Approved by: Robert Mustacchi <rm at joyent.com>
  Author: Paul Dagnelie <pcd at delphix.com>

Modified:
  vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c

Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c
==============================================================================
--- vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c	Fri Apr 14 18:52:48 2017	(r316933)
+++ vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c	Fri Apr 14 18:54:11 2017	(r316934)
@@ -3173,7 +3173,12 @@ zfs_receive_one(libzfs_handle_t *hdl, in
 	/*
 	 * Determine the name of the origin snapshot, store in zc_string.
 	 */
-	if (drrb->drr_flags & DRR_FLAG_CLONE) {
+	if (originsnap) {
+		(void) strncpy(zc.zc_string, originsnap, sizeof (zc.zc_string));
+		if (flags->verbose)
+			(void) printf("using provided clone origin %s\n",
+			    zc.zc_string);
+	} else if (drrb->drr_flags & DRR_FLAG_CLONE) {
 		if (guid_to_name(hdl, zc.zc_value,
 		    drrb->drr_fromguid, B_FALSE, zc.zc_string) != 0) {
 			zcmd_free_nvlists(&zc);
@@ -3184,11 +3189,6 @@ zfs_receive_one(libzfs_handle_t *hdl, in
 		}
 		if (flags->verbose)
 			(void) printf("found clone origin %s\n", zc.zc_string);
-	} else if (originsnap) {
-		(void) strncpy(zc.zc_string, originsnap, sizeof (zc.zc_string));
-		if (flags->verbose)
-			(void) printf("using provided clone origin %s\n",
-			    zc.zc_string);
 	}
 
 	boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &


More information about the svn-src-all mailing list