diff options
author | avg <avg@FreeBSD.org> | 2015-06-24 14:37:55 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2015-06-24 14:37:55 +0000 |
commit | f0758faa127ce0769df2797b63e4c2b63974d077 (patch) | |
tree | 8b414b66a523782a829afdc186fd08f6df781551 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c | |
parent | 77286cbd994e15d9c779bbe84fe79d772bf6e91f (diff) | |
download | FreeBSD-src-f0758faa127ce0769df2797b63e4c2b63974d077.zip FreeBSD-src-f0758faa127ce0769df2797b63e4c2b63974d077.tar.gz |
MFC r284301: MFV r284040: check that datasets are snapshots
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 | 4 |
1 files changed, 4 insertions, 0 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 adee4f8..fd6e800 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 @@ -855,6 +855,10 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl_dataset_t *fromds, uint64_t *sizep) if (!dsl_dataset_is_snapshot(ds)) return (SET_ERROR(EINVAL)); + /* fromsnap, if provided, must be a snapshot */ + if (fromds != NULL && !dsl_dataset_is_snapshot(fromds)) + return (SET_ERROR(EINVAL)); + /* * fromsnap must be an earlier snapshot from the same fs as tosnap, * or the origin's fs. |