5912 full stream can not be force-received into a dataset if it has a snapshot

Author: Andriy Gapon <avg@freebsd.org>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>

illumos/illumos-gate@5bae108fe2
This commit is contained in:
Andriy Gapon 2015-06-05 17:07:13 +00:00
parent 9055704db3
commit 368274c23b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor-sys/illumos/dist/; revision=284037

View File

@ -949,10 +949,12 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds,
dsl_dataset_rele(snap, FTAG);
} else {
/* if full, most recent snapshot must be $ORIGIN */
if (dsl_dataset_phys(ds)->ds_prev_snap_txg >= TXG_INITIAL)
return (SET_ERROR(ENODEV));
drba->drba_snapobj = dsl_dataset_phys(ds)->ds_prev_snap_obj;
/* if full, then must be forced */
if (!drba->drba_cookie->drc_force)
return (SET_ERROR(EEXIST));
/* start from $ORIGIN@$ORIGIN, if supported */
drba->drba_snapobj = dp->dp_origin_snap != NULL ?
dp->dp_origin_snap->ds_object : 0;
}
return (0);