Date: Mon, 25 May 2015 11:56:58 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283525 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201505251156.t4PBuwPx084211@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Mon May 25 11:56:57 2015 New Revision: 283525 URL: https://svnweb.freebsd.org/changeset/base/283525 Log: zfs: fixes for a full stream received into an existing dataset - this should fail early unless the force flag is set - if the force flag is set then any local modifications including snapshots should be undone See: https://www.illumos.org/issues/5912 See: https://reviews.csiden.org/r/220/ Reviewed by: mahrens, Paul Dagnelie <pcd@delphix.com> MFC after: 15 days Sponsored by: ClusterHQ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:48:15 2015 (r283524) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:56:57 2015 (r283525) @@ -983,10 +983,12 @@ recv_begin_check_existing_impl(dmu_recv_ 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505251156.t4PBuwPx084211>