summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGeorge Melikov <[email protected]>2017-01-27 22:47:54 +0300
committerBrian Behlendorf <[email protected]>2017-01-27 11:47:54 -0800
commit160af771081bc21313ad0c111d66b348932fe5d2 (patch)
tree58855f1aeb448c5a27ad7ab6c29c946651e938fe /lib
parenta08abc1bb3e354d8c352c91d22cc733a84fafb50 (diff)
OpenZFS 7340 - receive manual origin should override automatic origin
Authored by: Paul Dagnelie <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Robert Mustacchi <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: George Melikov <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7340 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ed4e7a6 Closes #5681
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_sendrecv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index a6650a45f..70488aa97 100644
--- a/lib/libzfs/libzfs_sendrecv.c
+++ b/lib/libzfs/libzfs_sendrecv.c
@@ -3225,7 +3225,12 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
/*
* Determine the name of the origin snapshot.
*/
- if (drrb->drr_flags & DRR_FLAG_CLONE) {
+ if (originsnap) {
+ (void) strncpy(origin, originsnap, sizeof (origin));
+ if (flags->verbose)
+ (void) printf("using provided clone origin %s\n",
+ origin);
+ } else if (drrb->drr_flags & DRR_FLAG_CLONE) {
if (guid_to_name(hdl, destsnap,
drrb->drr_fromguid, B_FALSE, origin) != 0) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
@@ -3236,11 +3241,6 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
}
if (flags->verbose)
(void) printf("found clone origin %s\n", origin);
- } else if (originsnap) {
- (void) strncpy(origin, originsnap, sizeof (origin));
- if (flags->verbose)
- (void) printf("using provided clone origin %s\n",
- origin);
}
boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &