summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2015-06-24 14:37:55 +0000
committeravg <avg@FreeBSD.org>2015-06-24 14:37:55 +0000
commitf0758faa127ce0769df2797b63e4c2b63974d077 (patch)
tree8b414b66a523782a829afdc186fd08f6df781551 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
parent77286cbd994e15d9c779bbe84fe79d772bf6e91f (diff)
downloadFreeBSD-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.c4
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.
OpenPOWER on IntegriCloud