Date: Fri, 5 Jun 2015 17:10:00 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284040 - vendor-sys/illumos/dist/uts/common/fs/zfs Message-ID: <201506051710.t55HA0pj020861@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Fri Jun 5 17:09:59 2015 New Revision: 284040 URL: https://svnweb.freebsd.org/changeset/base/284040 Log: 5946 zfs_ioc_space_snaps must check that firstsnap and lastsnap refer to snapshots Author: Andriy Gapon <avg@freebsd.org> Reviewed by: Steven Hartland <killing@multiplay.co.uk> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Gordon Ross <gordon.ross@nexenta.com> illumos/illumos-gate@24218bebb460e4015fac2c9f2cec1902eddbcd7b Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Fri Jun 5 17:08:32 2015 (r284039) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Fri Jun 5 17:09:59 2015 (r284040) @@ -821,6 +821,10 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl if (!ds->ds_is_snapshot) return (SET_ERROR(EINVAL)); + /* fromsnap, if provided, must be a snapshot */ + if (fromds != NULL && !fromds->ds_is_snapshot) + return (SET_ERROR(EINVAL)); + /* * fromsnap must be an earlier snapshot from the same fs as tosnap, * or the origin's fs. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 5 17:08:32 2015 (r284039) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 5 17:09:59 2015 (r284040) @@ -5258,11 +5258,19 @@ zfs_ioc_space_snaps(const char *lastsnap return (error); error = dsl_dataset_hold(dp, lastsnap, FTAG, &new); + if (error == 0 && !new->ds_is_snapshot) { + dsl_dataset_rele(new, FTAG); + error = SET_ERROR(EINVAL); + } if (error != 0) { dsl_pool_rele(dp, FTAG); return (error); } error = dsl_dataset_hold(dp, firstsnap, FTAG, &old); + if (error == 0 && !old->ds_is_snapshot) { + dsl_dataset_rele(old, FTAG); + error = SET_ERROR(EINVAL); + } if (error != 0) { dsl_dataset_rele(new, FTAG); dsl_pool_rele(dp, FTAG);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506051710.t55HA0pj020861>