mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
OpenZFS 7340 - receive manual origin should override automatic origin
Authored by: Paul Dagnelie <pcd@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Ported-by: George Melikov <mail@gmelikov.ru> OpenZFS-issue: https://www.illumos.org/issues/7340 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ed4e7a6 Closes #5681
This commit is contained in:
parent
a08abc1bb3
commit
160af77108
@ -3225,7 +3225,12 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
|||||||
/*
|
/*
|
||||||
* Determine the name of the origin snapshot.
|
* 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,
|
if (guid_to_name(hdl, destsnap,
|
||||||
drrb->drr_fromguid, B_FALSE, origin) != 0) {
|
drrb->drr_fromguid, B_FALSE, origin) != 0) {
|
||||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
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)
|
if (flags->verbose)
|
||||||
(void) printf("found clone origin %s\n", origin);
|
(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) &
|
boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
|
||||||
|
Loading…
Reference in New Issue
Block a user