Skip to content

Commit cf50a2b

Browse files
avg-Ibehlendorf
authored andcommitted
Illumos 5912 - full stream can not be force-received into a dataset if it has a snapshot
5912 full stream can not be force-received into a dataset if it has a snapshot Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Approved by: Dan McDonald <danmcd@omniti.com> References: https://www.illumos.org/issues/5912 illumos/illumos-gate@5bae108 Ported-by: Andriy Gapon <avg@FreeBSD.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3549
1 parent a7b10a9 commit cf50a2b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

module/zfs/dmu_send.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,10 +1036,12 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds,
10361036

10371037
dsl_dataset_rele(snap, FTAG);
10381038
} else {
1039-
/* if full, most recent snapshot must be $ORIGIN */
1040-
if (dsl_dataset_phys(ds)->ds_prev_snap_txg >= TXG_INITIAL)
1041-
return (SET_ERROR(ENODEV));
1042-
drba->drba_snapobj = dsl_dataset_phys(ds)->ds_prev_snap_obj;
1039+
/* if full, then must be forced */
1040+
if (!drba->drba_cookie->drc_force)
1041+
return (SET_ERROR(EEXIST));
1042+
/* start from $ORIGIN@$ORIGIN, if supported */
1043+
drba->drba_snapobj = dp->dp_origin_snap != NULL ?
1044+
dp->dp_origin_snap->ds_object : 0;
10431045
}
10441046

10451047
return (0);

0 commit comments

Comments
 (0)