summaryrefslogtreecommitdiffstats
path: root/sysfs.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-08-15 10:58:43 -0700
committerDan Williams <dan.j.williams@intel.com>2008-08-15 10:58:43 -0700
commitf1d267661dc681dfe9bc1c9c6ad246617206d30f (patch)
tree77dadd97bcc050c524af07c6192fdc2eb917715c /sysfs.c
parentfcb844757f8cee1221fb0f7e2b4ced14e44cb572 (diff)
downloadmdadm-f1d267661dc681dfe9bc1c9c6ad246617206d30f.tar.gz
mdadm-f1d267661dc681dfe9bc1c9c6ad246617206d30f.tar.xz
mdadm-f1d267661dc681dfe9bc1c9c6ad246617206d30f.zip
mdmon: allow degraded arrays to be monitored
manage_new is too strict in the face of failed devices. Teach it to monitor degraded arrays. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysfs.c b/sysfs.c
index 0ea17eb..7ca40c3 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -153,6 +153,12 @@ struct mdinfo *sysfs_read(int fd, int devnum, unsigned long options)
goto abort;
sra->array.raid_disks = strtoul(buf, NULL, 0);
}
+ if (options & GET_DEGRADED) {
+ strcpy(base, "degraded");
+ if (load_sys(fname, buf))
+ goto abort;
+ sra->array.failed_disks = strtoul(buf, NULL, 0);
+ }
if (options & GET_COMPONENT) {
strcpy(base, "component_size");
if (load_sys(fname, buf))