summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Jude <allan@klarasystems.com>2021-09-09 10:17:31 -0400
committerTony Hutter <hutter2@llnl.gov>2021-09-14 15:42:49 -0700
commitcea0752f8d14792b8a8d4484649c8a7022678b66 (patch)
tree7abf7830858ea57767df569cadc91fdccf7c59e0
parent7d70f1e09971d2ffac9c4557bdd59ce8e8bc5035 (diff)
Allow sending corrupt snapshots even if metadata is corrupted
When zfs_send_corrupt_data is set, use the TRAVERSE_HARD flag, so traverse_visitbp() will not fail with ECKSUM if a blockpointer cannot be read, but rather will continue and send the objects it can. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Allan Jude <allan@klarasystems.com> Sponsored-By: Klara Inc. Sponsored-By: WHC Online Solutions Inc. Closes #12541
-rw-r--r--module/zfs/dmu_send.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c
index d65438223..0658e13c2 100644
--- a/module/zfs/dmu_send.c
+++ b/module/zfs/dmu_send.c
@@ -2054,6 +2054,8 @@ setup_to_thread(struct send_thread_arg *to_arg, objset_t *to_os,
to_arg->flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA;
if (rawok)
to_arg->flags |= TRAVERSE_NO_DECRYPT;
+ if (zfs_send_corrupt_data)
+ to_arg->flags |= TRAVERSE_HARD;
to_arg->num_blocks_visited = &dssp->dss_blocks;
(void) thread_create(NULL, 0, send_traverse_thread, to_arg, 0,
curproc, TS_RUN, minclsyspri);