diff options
author | mm <mm@FreeBSD.org> | 2013-02-11 13:59:57 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2013-02-11 13:59:57 +0000 |
commit | eb36612c3261ea6fb263854724f545317a5d4b2e (patch) | |
tree | 1939bf5bad7288e9d7b05d1761afdd7ad00e4e35 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c | |
parent | ccc66b91fb440e1b4e0b229f8d4ce003f4dc1c79 (diff) | |
download | FreeBSD-src-eb36612c3261ea6fb263854724f545317a5d4b2e.zip FreeBSD-src-eb36612c3261ea6fb263854724f545317a5d4b2e.tar.gz |
MFV r246394:
Add tunable to allow block allocation on degraded vdevs.
Illumos ZFS issues:
3507 Tunable to allow block allocation even on degraded vdevs
References:
https://www.illumos.org/issues/3507
MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c index 5d83f69..53ffa90 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c @@ -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> @@ -97,6 +98,15 @@ 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; +SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RW, + &zfs_write_to_degraded, 0, + "Allow writing data to degraded vdevs"); +TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); + +/* * ========================================================================== * Metaslab classes * ========================================================================== @@ -1383,10 +1393,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; } |