summaryrefslogtreecommitdiffstats
path: root/module/zfs/metaslab.c
diff options
context:
space:
mode:
authorGeorge Wilson <[email protected]>2013-10-04 14:13:23 -0800
committerBrian Behlendorf <[email protected]>2013-11-05 12:25:44 -0800
commit43a696ed38cae25ec2d7b6466ab4a99eb86df7bd (patch)
tree375da447e71ad1c004914b7eb93bf80a837a41bd /module/zfs/metaslab.c
parent92bc214c2e00bd4a430eac1629f1bcf2fc590d51 (diff)
Illumos #4168, #4169, #4170
4168 ztest assertion failure in dbuf_undirty 4169 verbatim import causes zdb to segfault 4170 zhack leaves pool in ACTIVE state Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Eric Schrock <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/4168 https://www.illumos.org/issues/4169 https://www.illumos.org/issues/4170 illumos/illumos-gate@7fdd916c474ea52896c671bbe7b56ba34a1ca132 Ported-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #1775
Diffstat (limited to 'module/zfs/metaslab.c')
-rw-r--r--module/zfs/metaslab.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c
index f01a8893e..f49a8adc6 100644
--- a/module/zfs/metaslab.c
+++ b/module/zfs/metaslab.c
@@ -118,6 +118,11 @@ int metaslab_prefetch_limit = SPA_DVAS_PER_BP;
int metaslab_smo_bonus_pct = 150;
/*
+ * Should we be willing to write data to degraded vdevs?
+ */
+boolean_t zfs_write_to_degraded = B_FALSE;
+
+/*
* ==========================================================================
* Metaslab classes
* ==========================================================================
@@ -1725,10 +1730,13 @@ top:
/*
* Avoid writing single-copy data to a failing vdev
+ * unless the user instructs us that it is okay.
*/
if ((vd->vdev_stat.vs_write_errors > 0 ||
vd->vdev_state < VDEV_STATE_HEALTHY) &&
- d == 0 && dshift == 3) {
+ d == 0 && dshift == 3 &&
+ !(zfs_write_to_degraded && vd->vdev_state ==
+ VDEV_STATE_DEGRADED)) {
all_zero = B_FALSE;
goto next;
}