]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Merge branch 'master' into devel-3.0
authorNeil Brown <neilb@suse.de>
Thu, 19 Jun 2008 06:38:37 +0000 (16:38 +1000)
committerNeil Brown <neilb@suse.de>
Thu, 19 Jun 2008 06:38:37 +0000 (16:38 +1000)
Conflicts:

Makefile

14 files changed:
ANNOUNCE-2.6.6 [new file with mode: 0644]
ANNOUNCE-2.6.7 [new file with mode: 0644]
Assemble.c
ChangeLog
Makefile
ReadMe.c
inventory
mdadm.8
mdadm.c
mdadm.spec
mdassemble.8
super0.c
test
tests/07autoassemble [new file with mode: 0644]

diff --git a/ANNOUNCE-2.6.6 b/ANNOUNCE-2.6.6
new file mode 100644 (file)
index 0000000..8253429
--- /dev/null
@@ -0,0 +1,27 @@
+Subject:  ANNOUNCE: mdadm 2.6.6 - A tool for managing Soft RAID under Linux
+
+I am pleased to announce the availability of
+   mdadm version 2.6.6
+
+It is available at the usual places:
+   countrycode=xx.
+   http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
+and via git at
+   git://neil.brown.name/mdadm
+   http://neil.brown.name/git?p=mdadm
+
+mdadm is a tool for creating, managing and monitoring
+device arrays using the "md" driver in Linux, also
+known as Software RAID arrays.
+
+Release 2.6.6 fixes a compile problem in 2.6.5 and adds a small manpage update.
+
+Changelog Entries:
+    -   "make everything" now make mdassemble.auto
+    -   fix compile problem with mdassemble.auto
+    -   Update FAQ URLs in man page again.
+
+Development of mdadm is sponsored by
+ SUSE Labs, Novell Inc.
+
+NeilBrown  19th May 2007
diff --git a/ANNOUNCE-2.6.7 b/ANNOUNCE-2.6.7
new file mode 100644 (file)
index 0000000..5fa4a80
--- /dev/null
@@ -0,0 +1,27 @@
+Subject:  ANNOUNCE: mdadm 2.6.7 - A tool for managing Soft RAID under Linux
+
+I am pleased to announce the availability of
+   mdadm version 2.6.7
+
+It is available at the usual places:
+   countrycode=xx.
+   http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
+and via git at
+   git://neil.brown.name/mdadm
+   http://neil.brown.name/git?p=mdadm
+
+mdadm is a tool for creating, managing and monitoring
+device arrays using the "md" driver in Linux, also
+known as Software RAID arrays.
+
+Release 2.6.7 fixes a few bugs in 2.6.5 which 2.6.6 didn't fix.
+
+Changelog Entries:
+    -   Avoid NULL reference calling free_super and elsewhere.
+    -   Remove stray semicolon (Causes compile error with gcc-2.95)
+    -   Fix autoassemble for stack arrays.
+
+Development of mdadm is sponsored by
+ SUSE Labs, Novell Inc.
+
+NeilBrown  6th June 2008
index 16f45cdf1ddc6bd21afa95ffec6e91e29633ed74..cb2725db5ebe6db9a48606a0b67bd852cc295690 100644 (file)
@@ -367,7 +367,8 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                tmpdev->used = 1;
 
        loop:
-               tst->ss->free_super(tst);
+               if (tst)
+                       tst->ss->free_super(tst);
        }
 
        if (mdfd < 0) {
@@ -377,7 +378,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                 */
                mdu_array_info_t inf;
                char *c;
-               if (!st->sb) {
+               if (!st || !st->sb) {
                        return 2;
                }
                st->ss->getinfo_super(st, &info);
@@ -568,17 +569,18 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                devcnt++;
        }
 
-       if (update && strcmp(update, "byteorder")==0)
-               st->minor_version = 90;
-
        if (devcnt == 0) {
                fprintf(stderr, Name ": no devices found for %s\n",
                        mddev);
-               st->ss->free_super(st);
+               if (st)
+                       st->ss->free_super(st);
                if (must_close) close(mdfd);
                return 1;
        }
 
+       if (update && strcmp(update, "byteorder")==0)
+               st->minor_version = 90;
+
        st->ss->getinfo_super(st, &info);
        clean = info.array.state & 1;
 
@@ -654,7 +656,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                        continue;
                }
                tst = dup_super(st);
-               if (tst->ss->load_super(st,fd, NULL)) {
+               if (tst->ss->load_super(tst,fd, NULL)) {
                        close(fd);
                        fprintf(stderr, Name ": RAID superblock disappeared from %s - not updating.\n",
                                devices[chosen_drive].devname);
@@ -1020,7 +1022,10 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                                        "start the array while not clean "
                                        "- consider --force.\n");
 
-                       if (must_close) close(mdfd);
+                       if (must_close) {
+                               ioctl(mdfd, STOP_ARRAY, NULL);
+                               close(mdfd);
+                       }
                        return 1;
                }
                if (runstop == -1) {
@@ -1054,7 +1059,10 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                                fprintf(stderr, " (use --run to insist).\n");
                        }
                }
-               if (must_close) close(mdfd);
+               if (must_close) {
+                       ioctl(mdfd, STOP_ARRAY, NULL);
+                       close(mdfd);
+               }
                return 1;
        } else {
                /* The "chosen_drive" is a good choice, and if necessary, the superblock has
index e22e4c8b6de9ef50b98942bbe3871e7c39cb21e5..c6bc0f1e8f2aa1652e307fce187a50eddafd0cd2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Changes Prior to 2.6.7 release
+    -   Avoid NULL reference calling free_super and elsewhere.
+    -   Remove stray semicolon (Causes compile error with gcc-2.95)
+    -   Fix autoassemble for stack arrays.
+
+Changes Prior to 2.6.6 release
+    -   "make everything" now make mdassemble.auto
+    -   fix compile problem with mdassemble.auto
+    -   Update FAQ URLs in man page again.
+
 Changes Prior to 2.6.5 release
     -   Avoid segfault when parsing /proc/mdstat with auto-read-only
        arrays.
index 68b3891870fe601c4ed283f420e85852fdd3a2b9..409df2101350fe1a15a30f220a1b0039b901fd76 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -87,16 +87,17 @@ STATICOBJS = pwgr.o
 
 ASSEMBLE_SRCS := mdassemble.c Assemble.c Manage.c config.c dlink.c util.c \
        super0.c super1.c super-ddf.c super-intel.c sha1.c crc32.c sg_io.c
+ASSEMBLE_AUTO_SRCS := mdopen.c mdstat.c sysfs.c
 ASSEMBLE_FLAGS:= $(CFLAGS) -DMDASSEMBLE
 ifdef MDASSEMBLE_AUTO
-ASSEMBLE_SRCS += mdopen.c mdstat.c
+ASSEMBLE_SRCS += $(ASSEMBLE_AUTO_SRCS)
 ASSEMBLE_FLAGS += -DMDASSEMBLE_AUTO
 endif
 
 all : mdadm mdmon mdadm.man md.man mdadm.conf.man
 
 everything: all mdadm.static swap_super test_stripe \
-       mdassemble mdassemble.static mdassemble.man \
+       mdassemble mdassemble.auto mdassemble.static mdassemble.man \
        mdadm.Os mdadm.O2
 # mdadm.uclibc and mdassemble.uclibc don't work on x86-64
 # mdadm.tcc doesn't work..
@@ -138,6 +139,11 @@ mdassemble.static : $(ASSEMBLE_SRCS) mdadm.h
        rm -f $(OBJS)
        $(CC) $(LDFLAGS) $(ASSEMBLE_FLAGS) -static -DHAVE_STDINT_H -o mdassemble.static $(ASSEMBLE_SRCS) $(STATICSRC)
 
+mdassemble.auto : $(ASSEMBLE_SRCS) mdadm.h $(ASSEMBLE_AUTO_SRCS)
+       rm -f mdassemble.static
+       $(MAKE) MDASSEMBLE_AUTO=1 mdassemble.static
+       mv mdassemble.static mdassemble.auto
+
 mdassemble.uclibc : $(ASSEMBLE_SRCS) mdadm.h
        rm -f $(OJS)
        $(UCLIBC_GCC) $(ASSEMBLE_FLAGS) -DUCLIBC -DHAVE_STDINT_H -static -o mdassemble.uclibc $(ASSEMBLE_SRCS) $(STATICSRC)
@@ -194,7 +200,8 @@ clean :
        rm -f mdadm mdmon $(OBJS) $(MON_OBJS) $(STATICOBJS) core *.man \
        mdadm.tcc mdadm.uclibc mdadm.static *.orig *.porig *.rej *.alt \
        mdadm.Os mdadm.O2 \
-       mdassemble mdassemble.static mdassemble.uclibc mdassemble.klibc swap_super \
+       mdassemble mdassemble.static mdassemble.auto mdassemble.uclibc \
+       mdassemble.klibc swap_super \
        init.cpio.gz mdadm.uclibc.static test_stripe
 
 dist : clean
index a52f0800af49118d539099af2b6087fda4ba0170..3fae1930654bdca81d099466648c8e94d2aab890 100644 (file)
--- a/ReadMe.c
+++ b/ReadMe.c
@@ -24,7 +24,7 @@
 
 #include "mdadm.h"
 
-char Version[] = Name " - v2.6.5 - 15th May 2008\n";
+char Version[] = Name " - v2.6.7 - 6th June 2008\n";
 
 /*
  * File: ReadMe.c
index a3b29c2462254ad8eedbeb629cd6433ae0646353..8c0a8d1894ce01ccf5e90488b28ed1486a5ede2c 100755 (executable)
--- a/inventory
+++ b/inventory
@@ -20,6 +20,8 @@ ANNOUNCE-2.6.2
 ANNOUNCE-2.6.3
 ANNOUNCE-2.6.4
 ANNOUNCE-2.6.5
+ANNOUNCE-2.6.6
+ANNOUNCE-2.6.7
 Assemble.c
 bitmap.c
 bitmap.h
@@ -116,6 +118,7 @@ tests/06r5swap
 tests/06sysfs
 tests/06update-uuid
 tests/06wrmostly
+tests/07autoassemble
 tests/07autodetect
 tests/07testreshape5
 tests/check
diff --git a/mdadm.8 b/mdadm.8
index a5d8e0dce018fd612f1a02e43e9eb5ba6867b16a..f0381b6914b9555b1bb73d0656c14ce4d42017aa 100644 (file)
--- a/mdadm.8
+++ b/mdadm.8
@@ -5,7 +5,7 @@
 .\"   the Free Software Foundation; either version 2 of the License, or
 .\"   (at your option) any later version.
 .\" See file COPYING in distribution for details.
-.TH MDADM 8 "" v2.6.5
+.TH MDADM 8 "" v2.6.7
 .SH NAME
 mdadm \- manage MD devices
 .I aka
@@ -2105,17 +2105,15 @@ package, and does not use the
 configuration file at all.
 
 .SH SEE ALSO
-For further information on MD and the various levels of
+For further information on mdadm usage, MD and the various levels of
 RAID, see:
 
-.IP
-.UR  http://unthought.net/Software-RAID.HOWTO/
-http://unthought.net/Software\-RAID.HOWTO/
-.UE
 .IP
 .UR http://linux-raid.osdl.org/
 http://linux\-raid.osdl.org/
 .UE
+.PP
+(based upon Jakob \(/Ostergaard's Software\-RAID.HOWTO)
 .\".PP
 .\"for new releases of the RAID driver check out:
 .\"
diff --git a/mdadm.c b/mdadm.c
index 4d7025e3808971b4f04413f53a1e9d108b6efe94..8b4b5dffbacceb81dbb05fb7e438ead3052abecc 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -1100,11 +1100,12 @@ int main(int argc, char *argv[])
                                int acnt;
                                ident.autof = autof;
                                do {
+                                       mddev_dev_t devlist = conf_get_devs();
                                        acnt = 0;
                                        do {
                                                rv2 = Assemble(ss, NULL, -1,
                                                               &ident,
-                                                              NULL, NULL,
+                                                              devlist, NULL,
                                                               readonly, runstop, NULL, homehost, verbose-quiet, force);
                                                if (rv2==0) {
                                                        cnt++;
@@ -1138,7 +1139,8 @@ int main(int argc, char *argv[])
                                if (cnt == 0 && rv == 0) {
                                        fprintf(stderr, Name ": No arrays found in config file or automatically\n");
                                        rv = 1;
-                               }
+                               } else if (cnt)
+                                       rv = 0;
                        } else if (cnt == 0 && rv == 0) {
                                fprintf(stderr, Name ": No arrays found in config file\n");
                                rv = 1;
index dfb9dc5b677d8df375ffa50b44d35c64519c234c..8e1a9bbc0b8c756f1a72c2ae7f9104a425063e06 100644 (file)
@@ -1,6 +1,6 @@
 Summary:     mdadm is used for controlling Linux md devices (aka RAID arrays)
 Name:        mdadm
-Version:     2.6.5
+Version:     2.6.7
 Release:     1
 Source:      http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tgz
 URL:         http://neil.brown.name/blog/mdadm
index 945c276c1fce6b62a0bd2920840e3f812ffb51f4..d60c775d73e210bfc87ee466a02ed5df3c04a277 100644 (file)
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH MDASSEMBLE 8 "" v2.6.5
+.TH MDASSEMBLE 8 "" v2.6.7
 .SH NAME
 mdassemble \- assemble MD devices
 .I aka
index 5c2ee879a781a6185809b109d71308024a342bcc..b0a625bde57cd4e4a34fcc85e5d000f062105e7a 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -876,12 +876,15 @@ static struct supertype *match_metadata_desc0(char *arg)
        st->sb = NULL;
        if (strcmp(arg, "0") == 0 ||
            strcmp(arg, "0.90") == 0 ||
-           strcmp(arg, "0.91") == 0 ||
            strcmp(arg, "default") == 0 ||
            strcmp(arg, "") == 0 /* no metadata */
                )
                return st;
 
+       st->minor_version = 91; /* reshape in progress */
+       if (strcmp(arg, "0.91") == 0) /* For dup_super support */
+               return st;
+
        st->minor_version = 9; /* flag for 'byte-swapped' */
        if (strcmp(arg, "0.swap")==0 ||
            strcmp(arg, "0.9") == 0) /* For dup_super support */
diff --git a/test b/test
index d2719854717a08ffbf2eaa5a292886f7b8dee9f6..a62d7e319f7343dc4c9d89006c738c893c49ce2c 100644 (file)
--- a/test
+++ b/test
@@ -30,6 +30,8 @@ targetdir=/var/tmp
 size=20000
 # super0, round down to multiple of 64 and substract 64
 mdsize0=19904
+# super00 is nested, subtract 128
+mdsize00=19840
 # super1.0 round down to multiple of 2, subtract 8
 mdsize1=19992
 # subtract another 4 for bitmaps
diff --git a/tests/07autoassemble b/tests/07autoassemble
new file mode 100644 (file)
index 0000000..4496476
--- /dev/null
@@ -0,0 +1,23 @@
+
+# create two raid1s, build a raid0 on top, then
+# tear it down and get auto-assemble to rebuild it.
+
+mdadm -CR $md1 -l1 -n2 $dev0 $dev1  --homehost=testing
+mdadm -CR $md2 -l1 -n2 $dev2 $dev3  --homehost=testing
+mdadm -CR $md0 -l0 -n2 $md1 $md2  --homehost=testing
+
+mdadm -Ss
+mdadm -As -c /dev/null --homehost=testing -vvv
+testdev $md1 1 $mdsize0 64
+testdev $md2 1 $mdsize0 64
+testdev $md0 2 $mdsize00 64
+mdadm -Ss
+
+mdadm --zero-superblock $dev0 $dev1 $dev2 $dev3
+## Now the raid0 uses one stacked and one not
+mdadm -CR $md1 -l1 -n2 $dev0 $dev1  --homehost=testing
+mdadm -CR $md0 -l0 -n2 $md1 $dev2  --homehost=testing
+mdadm -Ss
+mdadm -As -c /dev/null --homehost=testing -vvv
+testdev $md1 1 $mdsize0 64
+testdev $md0 1 $[mdsize0+mdsize00] 64