mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 03:19:35 +03:00
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 https://github.com/illumos/illumos-gate/commit/5bae108 Ported-by: Andriy Gapon <avg@FreeBSD.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3549
This commit is contained in:
parent
a7b10a9319
commit
cf50a2b08f
@ -1036,10 +1036,12 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds,
|
|||||||
|
|
||||||
dsl_dataset_rele(snap, FTAG);
|
dsl_dataset_rele(snap, FTAG);
|
||||||
} else {
|
} else {
|
||||||
/* if full, most recent snapshot must be $ORIGIN */
|
/* if full, then must be forced */
|
||||||
if (dsl_dataset_phys(ds)->ds_prev_snap_txg >= TXG_INITIAL)
|
if (!drba->drba_cookie->drc_force)
|
||||||
return (SET_ERROR(ENODEV));
|
return (SET_ERROR(EEXIST));
|
||||||
drba->drba_snapobj = dsl_dataset_phys(ds)->ds_prev_snap_obj;
|
/* start from $ORIGIN@$ORIGIN, if supported */
|
||||||
|
drba->drba_snapobj = dp->dp_origin_snap != NULL ?
|
||||||
|
dp->dp_origin_snap->ds_object : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user