Skip to content

Commit

Permalink
3507 Tunable to allow block allocation even on degraded vdevs
Browse files Browse the repository at this point in the history
Reviewed by: George Wilson <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Approved by: Christopher Siden <[email protected]>
  • Loading branch information
skiselkov authored and Christopher Siden committed Feb 5, 2013
1 parent e98f46c commit 9dc3941
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion usr/src/uts/common/fs/zfs/metaslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/

#include <sys/zfs_context.h>
Expand Down Expand Up @@ -90,6 +91,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
Expand Down Expand Up @@ -1377,10 +1383,13 @@ metaslab_alloc_dva(spa_t *spa, metaslab_class_t *mc, uint64_t psize,

/*
* 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;
}
Expand Down

0 comments on commit 9dc3941

Please sign in to comment.