diff options
author | avg <avg@FreeBSD.org> | 2015-06-12 11:49:05 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2015-06-12 11:49:05 +0000 |
commit | 320785eb73c9a2cb9f54430e227bd72431d84a6f (patch) | |
tree | b3a7aa780459d97825a42b7bebbf392f00dda88d /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c | |
parent | 283a5c0b30a9b5bf421f10b1b5fac19aee3a4e26 (diff) | |
download | FreeBSD-src-320785eb73c9a2cb9f54430e227bd72431d84a6f.zip FreeBSD-src-320785eb73c9a2cb9f54430e227bd72431d84a6f.tar.gz |
MFC r283525: zfs: fixes for a full stream received into an existing dataset
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c index a0c1377..adee4f8 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c @@ -983,10 +983,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); |