aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev.c
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2018-03-13 12:43:14 -0500
committerBrian Behlendorf <[email protected]>2018-03-13 10:43:14 -0700
commit02638a30efb0e9800fdc8834d5b7ab66432db00a (patch)
tree297c7f37319b1ffbd0478bd874e14069d2b32b34 /module/zfs/vdev.c
parent83362e8e676a3ffae6b3b21f350f9b999a068605 (diff)
Add zfs_scan_ignore_errors tunable
When it's set, a DTL range will be cleared even if its scan/scrub had errors. This allows to work around resilver/scrub upon import when the pool has errors. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #7293
Diffstat (limited to 'module/zfs/vdev.c')
-rw-r--r--module/zfs/vdev.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c
index 172485f6e..8ab996434 100644
--- a/module/zfs/vdev.c
+++ b/module/zfs/vdev.c
@@ -67,6 +67,12 @@ unsigned int zfs_delays_per_second = 20;
unsigned int zfs_checksums_per_second = 20;
/*
+ * Ignore errors during scrub/resilver. Allows to work around resilver
+ * upon import when there are pool errors.
+ */
+int zfs_scan_ignore_errors = 0;
+
+/*
* Virtual device management.
*/
@@ -1964,6 +1970,12 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t txg, uint64_t scrub_txg, int scrub_done)
mutex_enter(&vd->vdev_dtl_lock);
/*
+ * If requested, pretend the scan completed cleanly.
+ */
+ if (zfs_scan_ignore_errors && scn)
+ scn->scn_phys.scn_errors = 0;
+
+ /*
* If we've completed a scan cleanly then determine
* if this vdev should remove any DTLs. We only want to
* excise regions on vdevs that were available during
@@ -3777,5 +3789,9 @@ module_param(zfs_checksums_per_second, uint, 0644);
MODULE_PARM_DESC(zfs_checksums_per_second, "Rate limit checksum events "
"to this many checksum errors per second (do not set below zed"
"threshold).");
+
+module_param(zfs_scan_ignore_errors, int, 0644);
+MODULE_PARM_DESC(zfs_scan_ignore_errors,
+ "Ignore errors during resilver/scrub");
/* END CSTYLED */
#endif