]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Examine.c
imsm: fix activate_spare off-by-one
[thirdparty/mdadm.git] / Examine.c
index 3827e7ed08086bc740799524f82701bb49de7bd6..3d0ea8a54ac336ae8bcf8ca844501ce58e37a9cc 100644 (file)
--- a/Examine.c
+++ b/Examine.c
@@ -1,7 +1,7 @@
 /*
  * mdadm - manage Linux "md" devices aka RAID arrays.
  *
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
  *
  *
  *    This program is free software; you can redistribute it and/or modify
  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  *    Author: Neil Brown
- *    Email: <neilb@cse.unsw.edu.au>
- *    Paper: Neil Brown
- *           School of Computer Science and Engineering
- *           The University of New South Wales
- *           Sydney, 2052
- *           Australia
+ *    Email: <neilb@suse.de>
  */
 
 #include       "mdadm.h"
@@ -119,10 +114,8 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
                                ap->st = st;
                                arrays = ap;
                                st->ss->getinfo_super(st, &ap->info);
-                       } else {
+                       } else
                                st->ss->getinfo_super(st, &ap->info);
-                               st->ss->free_super(st);
-                       }
                        if (!(ap->info.disk.state & (1<<MD_DISK_SYNC)))
                                ap->spares++;
                        d = dl_strdup(devlist->devname);
@@ -141,7 +134,7 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
                for (ap=arrays; ap; ap=ap->next) {
                        char sep='=';
                        char *d;
-                       ap->st->ss->brief_examine_super(ap->st);
+                       ap->st->ss->brief_examine_super(ap->st, brief > 1);
                        if (ap->spares) printf("   spares=%d", ap->spares);
                        if (brief > 1) {
                                printf("   devices");