From f89b6bcc3da8c1a9b85541c571d268d9f8f95cf0 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Tue, 6 Oct 2020 15:17:41 +0000 Subject: [PATCH] MFS12 r366180, r366341: r366180 (asomers): Fix resuming receive stream to dataset with mounted clone r366341 (asomers): Fix "zfs receive" of interrupted stream without "-F" Approved by: re (kib) Sponsored by: Rubicon Communications, LLC (netgate.com) --- .../contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c index 55556d7b037..bfb7f3923cf 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c @@ -3138,7 +3138,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, char prop_errbuf[1024]; const char *chopprefix; boolean_t newfs = B_FALSE; - boolean_t stream_wantsnewfs; + boolean_t stream_wantsnewfs, stream_resumingnewfs; uint64_t parent_snapguid = 0; prop_changelist_t *clp = NULL; nvlist_t *snapprops_nvlist = NULL; @@ -3302,6 +3302,8 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, DMU_BACKUP_FEATURE_RESUMING; stream_wantsnewfs = (drrb->drr_fromguid == 0 || (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && !resuming; + stream_resumingnewfs = (drrb->drr_fromguid == 0 || + (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && resuming; if (stream_wantsnewfs) { /* @@ -3433,7 +3435,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, } if (!flags->dryrun && zhp->zfs_type == ZFS_TYPE_FILESYSTEM && - (stream_wantsnewfs || resuming)) { + (stream_wantsnewfs || stream_resumingnewfs)) { /* We can't do online recv in this case */ clp = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0); if (clp == NULL) { -- 2.45.0