Skip to content

Commit

Permalink
OpenZFS 7340 - receive manual origin should override automatic origin
Browse files Browse the repository at this point in the history
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: openzfs/openzfs@ed4e7a6
Closes openzfs#5681
  • Loading branch information
gmelikov authored and behlendorf committed Jan 27, 2017
1 parent a08abc1 commit 160af77
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/libzfs/libzfs_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) &
Expand Down

0 comments on commit 160af77

Please sign in to comment.