Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2017 18:30:22 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r316922 - vendor/illumos/dist/lib/libzfs/common
Message-ID:  <201704141830.v3EIUMxT071312@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Apr 14 18:30:22 2017
New Revision: 316922
URL: https://svnweb.freebsd.org/changeset/base/316922

Log:
  5380 receive of a send -p stream doesn't need to try renaming snapshots
  
  illumos/illumos-gate@471a88e499c660844f4590487ce7c4d5a7090294
  https://github.com/illumos/illumos-gate/commit/471a88e499c660844f4590487ce7c4d5a7090294
  
  https://www.illumos.org/issues/5380
    A stream created with zfs send -p -I contains properties of all snapshots of a
    given dataset as opposed to only properties of snapshots in a given range.
    Not only this is suboptimal but the receive code also does not filter
    properties by the range. So, properties of earlier snapshots would be updated
    even though the snapshots themselves are not in the stream (just their
    properties).
    Given that modifying the snapshot properties requires a TXG sync and that the
    snapshots are updated one by one the described behavior may lead to a sever
    performance penalty.
  
  Reviewed by: Paul Dagnelie <pcd@delphix.com>
  Reviewed by: Matt Ahrens <mahrens@delphix.com>
  Approved by: Dan McDonald <danmcd@omniti.com>
  Author: Andriy Gapon <avg@FreeBSD.org>

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:29:35 2017	(r316921)
+++ vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c	Fri Apr 14 18:30:22 2017	(r316922)
@@ -2770,7 +2770,7 @@ zfs_receive_package(libzfs_handle_t *hdl
 			goto out;
 		}
 
-		if (fromsnap != NULL) {
+		if (fromsnap != NULL && recursive) {
 			nvlist_t *renamed = NULL;
 			nvpair_t *pair = NULL;
 
@@ -2797,7 +2797,7 @@ zfs_receive_package(libzfs_handle_t *hdl
 				*strchr(tofs, '@') = '\0';
 			}
 
-			if (recursive && !flags->dryrun && !flags->nomount) {
+			if (!flags->dryrun && !flags->nomount) {
 				VERIFY(0 == nvlist_alloc(&renamed,
 				    NV_UNIQUE_NAME, 0));
 			}
@@ -2866,7 +2866,7 @@ zfs_receive_package(libzfs_handle_t *hdl
 		anyerr |= error;
 	} while (error == 0);
 
-	if (drr->drr_payloadlen != 0 && fromsnap != NULL) {
+	if (drr->drr_payloadlen != 0 && recursive && fromsnap != NULL) {
 		/*
 		 * Now that we have the fs's they sent us, try the
 		 * renames again.



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