summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-05-15 15:50:47 +1000
committerNeil Brown <neilb@suse.de>2008-05-15 15:50:47 +1000
commit294d6f450f79fda5475e6e5c99b7be85393f03c6 (patch)
tree59acebb36928cd034961974d3bcbc2a91c59121d
parent3b0896f89988923c314cfb07454dde23b1b401fc (diff)
downloadmdadm-294d6f450f79fda5475e6e5c99b7be85393f03c6.tar.gz
mdadm-294d6f450f79fda5475e6e5c99b7be85393f03c6.tar.xz
mdadm-294d6f450f79fda5475e6e5c99b7be85393f03c6.zip
Recent change broken handling of metadata-less arrays.
In particular, failing a device would give a silly error message.
-rw-r--r--super0.c3
-rw-r--r--sysfs.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/super0.c b/super0.c
index 2476d77..f2d6d63 100644
--- a/super0.c
+++ b/super0.c
@@ -850,7 +850,8 @@ static struct supertype *match_metadata_desc0(char *arg)
if (strcmp(arg, "0") == 0 ||
strcmp(arg, "0.90") == 0 ||
strcmp(arg, "0.91") == 0 ||
- strcmp(arg, "default") == 0
+ strcmp(arg, "default") == 0 ||
+ strcmp(arg, "") == 0 /* no metadata */
)
return st;
diff --git a/sysfs.c b/sysfs.c
index 03b09fd..d77080b 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);