diff options
author | avg <avg@FreeBSD.org> | 2017-10-30 10:35:03 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2017-10-30 10:35:03 +0000 |
commit | f86c0b89ab84c577e303bd208d7a463b77578038 (patch) | |
tree | 40fa8eeaf85892ff355e6c88ca7bf62b8e03ec62 /cddl/contrib/opensolaris/lib/libzfs/common | |
parent | cc2007c550b522594d2a8b8225b6916c33a8d08a (diff) | |
download | FreeBSD-src-f86c0b89ab84c577e303bd208d7a463b77578038.zip FreeBSD-src-f86c0b89ab84c577e303bd208d7a463b77578038.tar.gz |
MFC r324348: MFV r316934: 7340 receive manual origin should override automatic origin
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c index 3e24741..85f6098 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c @@ -3212,7 +3212,12 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, /* * 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); @@ -3223,11 +3228,6 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, } 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) & |