From 294d6f450f79fda5475e6e5c99b7be85393f03c6 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 15 May 2008 15:50:47 +1000 Subject: Recent change broken handling of metadata-less arrays. In particular, failing a device would give a silly error message. --- sysfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sysfs.c') diff --git a/sysfs.c b/sysfs.c index 03b09fd8..d77080b9 100644 --- a/sysfs.c +++ b/sysfs.c @@ -103,10 +103,11 @@ struct mdinfo *sysfs_read(int fd, int devnum, unsigned long options) strcpy(base, "metadata_version"); if (load_sys(fname, buf)) goto abort; - if (strncmp(buf, "none", 4) == 0) + if (strncmp(buf, "none", 4) == 0) { sra->array.major_version = sra->array.minor_version = -1; - else if (strncmp(buf, "external:", 9) == 0) { + strcpy(sra->text_version, ""); + } else if (strncmp(buf, "external:", 9) == 0) { sra->array.major_version = -1; sra->array.minor_version = -2; strcpy(sra->text_version, buf+9); -- cgit v1.2.3