aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2019-06-10 12:45:08 -0400
committerBrian Behlendorf <[email protected]>2019-06-10 09:45:08 -0700
commitc08c30ed131800635576282e1d142b12fa33c76b (patch)
treeda39eb44af7221d16aa8404dee9c83c16a98cd9f
parentcfc16f8ba8e6e35fc4651059ee95abbb8bf92f62 (diff)
Fix incorrect error message for raw receive
This patch fixes an incorrect error message that comes up when doing a non-forcing, raw, incremental receive into a dataset that has a newer snapshot than the "from" snapshot. In this case, the current code prints a confusing message about an IVset guid mismatch. This functionality is supported by non-raw receives as an undocumented feature, but was never supported by the raw receive code. If this is desired in the future, we can probably figure out a way to make it work. Reviewed by: Brian Behlendorf <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Issue #8758 Closes #8863
-rw-r--r--module/zfs/dmu_recv.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c
index 976b1bd46..65a031b42 100644
--- a/module/zfs/dmu_recv.c
+++ b/module/zfs/dmu_recv.c
@@ -158,9 +158,16 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds,
} else {
/*
* If we are not forcing, there must be no
- * changes since fromsnap.
+ * changes since fromsnap. Raw sends have an
+ * additional constraint that requires that
+ * no "noop" snapshots exist between fromsnap
+ * and tosnap for the IVset checking code to
+ * work properly.
*/
- if (dsl_dataset_modified_since_snap(ds, snap)) {
+ if (dsl_dataset_modified_since_snap(ds, snap) ||
+ (raw &&
+ dsl_dataset_phys(ds)->ds_prev_snap_obj !=
+ snap->ds_object)) {
dsl_dataset_rele(snap, FTAG);
return (SET_ERROR(ETXTBSY));
}