diff --git a/.mdadm.metadata b/.mdadm.metadata new file mode 100644 index 0000000..3b6dc26 --- /dev/null +++ b/.mdadm.metadata @@ -0,0 +1 @@ +b2ee8e482c71685d77f1b19c5b9730962aaec448 SOURCES/mdadm-3.2.6.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/mdadm-2.5.2-static.patch b/SOURCES/mdadm-2.5.2-static.patch new file mode 100644 index 0000000..1eb335a --- /dev/null +++ b/SOURCES/mdadm-2.5.2-static.patch @@ -0,0 +1,23 @@ +--- mdadm-3.2.1/Makefile.static 2011-03-27 22:31:20.000000000 -0400 ++++ mdadm-3.2.1/Makefile 2011-03-28 10:16:55.277900184 -0400 +@@ -238,16 +238,16 @@ install : mdadm mdmon install-man instal + $(INSTALL) -D $(STRIP) -m 755 mdmon $(DESTDIR)$(BINDIR)/mdmon + + install-static : mdadm.static install-man +- $(INSTALL) -D $(STRIP) -m 755 mdadm.static $(DESTDIR)$(BINDIR)/mdadm ++ $(INSTALL) -D $(STRIP) -m 755 mdadm.static $(DESTDIR)$(BINDIR)/mdadm.static + + install-tcc : mdadm.tcc install-man +- $(INSTALL) -D $(STRIP) -m 755 mdadm.tcc $(DESTDIR)$(BINDIR)/mdadm ++ $(INSTALL) -D $(STRIP) -m 755 mdadm.tcc $(DESTDIR)$(BINDIR)/mdadm.tcc + + install-uclibc : mdadm.uclibc install-man +- $(INSTALL) -D $(STRIP) -m 755 mdadm.uclibc $(DESTDIR)$(BINDIR)/mdadm ++ $(INSTALL) -D $(STRIP) -m 755 mdadm.uclibc $(DESTDIR)$(BINDIR)/mdadm.uclibc + + install-klibc : mdadm.klibc install-man +- $(INSTALL) -D $(STRIP) -m 755 mdadm.klibc $(DESTDIR)$(BINDIR)/mdadm ++ $(INSTALL) -D $(STRIP) -m 755 mdadm.klibc $(DESTDIR)$(BINDIR)/mdadm.klibc + + install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8 + $(INSTALL) -D -m 644 mdadm.8 $(DESTDIR)$(MAN8DIR)/mdadm.8 diff --git a/SOURCES/mdadm-3.2.4-map-dir.patch b/SOURCES/mdadm-3.2.4-map-dir.patch new file mode 100644 index 0000000..f1e9865 --- /dev/null +++ b/SOURCES/mdadm-3.2.4-map-dir.patch @@ -0,0 +1,18 @@ +--- mdadm-3.2.4/Makefile.map-dir 2012-05-10 12:29:09.687578525 +0200 ++++ mdadm-3.2.4/Makefile 2012-05-10 12:28:05.514380800 +0200 +@@ -67,12 +67,12 @@ + # Both MAP_DIR and MDMON_DIR should be somewhere that persists across the + # pivotroot from early boot to late boot. + # /run is best, but for distros that don't support that, /dev can work. +-MAP_DIR=/run/mdadm +-MAP_FILE = map ++MAP_DIR=/dev/md ++MAP_FILE = md-device-map + MAP_PATH = $(MAP_DIR)/$(MAP_FILE) + MDMON_DIR = $(MAP_DIR) + # place for autoreplace cookies +-FAILED_SLOTS_DIR = /run/mdadm/failed-slots ++FAILED_SLOTS_DIR = $(MDMON_DIR)/failed-slots + DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\" + DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\" + DIRFLAGS += -DFAILED_SLOTS_DIR=\"$(FAILED_SLOTS_DIR)\" diff --git a/SOURCES/mdadm-3.2.6-Add-support-for-launching-mdmon-via-systemctl-instea.patch b/SOURCES/mdadm-3.2.6-Add-support-for-launching-mdmon-via-systemctl-instea.patch new file mode 100644 index 0000000..b7b6dfa --- /dev/null +++ b/SOURCES/mdadm-3.2.6-Add-support-for-launching-mdmon-via-systemctl-instea.patch @@ -0,0 +1,108 @@ +From 0f7bdf8946316548500858303549e396655450c5 Mon Sep 17 00:00:00 2001 +From: Jes Sorensen +Date: Fri, 1 Feb 2013 16:15:18 +0100 +Subject: [PATCH 2/4] Add support for launching mdmon via systemctl instead of + fork/exec + +If launching mdmon via systemctl fails, we fall back to the old method +of fork/exec. This allows for having mdmon launched via systemctl +which avoids problems with it getting killed by systemd due to it +ending up in the parent's cgroup (udev). + +Signed-off-by: Jes Sorensen +Signed-off-by: NeilBrown +--- + Makefile | 4 ++++ + systemd/mdmon@.service | 18 ++++++++++++++++++ + util.c | 28 ++++++++++++++++++++++++++++ + 3 files changed, 50 insertions(+) + create mode 100644 systemd/mdmon@.service + +diff --git a/Makefile b/Makefile +index b9787d6..b6edb23 100644 +--- a/Makefile ++++ b/Makefile +@@ -73,6 +73,7 @@ MAP_PATH = $(MAP_DIR)/$(MAP_FILE) + MDMON_DIR = $(MAP_DIR) + # place for autoreplace cookies + FAILED_SLOTS_DIR = /run/mdadm/failed-slots ++SYSTEMD_DIR=/lib/systemd/system + DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\" + DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\" + DIRFLAGS += -DFAILED_SLOTS_DIR=\"$(FAILED_SLOTS_DIR)\" +@@ -264,6 +265,9 @@ install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8 + install-udev: udev-md-raid.rules + $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)$(UDEVDIR)/rules.d/64-md-raid.rules + ++install-systemd: systemd/mdmon@.service ++ $(INSTALL) -D -m 644 systemd/mdmon@.service $(DESTDIR)$(SYSTEMD_DIR)/mdmon@.service ++ + uninstall: + rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm + +diff --git a/systemd/mdmon@.service b/systemd/mdmon@.service +new file mode 100644 +index 0000000..ddb475f +--- /dev/null ++++ b/systemd/mdmon@.service +@@ -0,0 +1,18 @@ ++# This file is part of mdadm. ++# ++# mdadm is free software; you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++ ++[Unit] ++Description=MD Metadata Monitor on /dev/%I ++DefaultDependencies=no ++Before=initrd-switch-root.target ++ ++[Service] ++ExecStart=/sbin/mdmon %I ++StandardInput=null ++StandardOutput=null ++StandardError=null ++KillMode=none +diff --git a/util.c b/util.c +index e75b754..01af0b5 100644 +--- a/util.c ++++ b/util.c +@@ -1660,6 +1660,34 @@ int start_mdmon(int devnum) + } else + pathbuf[0] = '\0'; + ++ /* First try to run systemctl */ ++ switch(fork()) { ++ case 0: ++ /* FIXME yuk. CLOSE_EXEC?? */ ++ skipped = 0; ++ for (i = 3; skipped < 20; i++) ++ if (close(i) < 0) ++ skipped++; ++ else ++ skipped = 0; ++ ++ snprintf(pathbuf, sizeof(pathbuf), "mdmon@%s.service", ++ devnum2devname(devnum)); ++ status = execl("/usr/bin/systemctl", "systemctl", "start", ++ pathbuf, NULL); ++ status = execl("/bin/systemctl", "systemctl", "start", ++ pathbuf, NULL); ++ exit(1); ++ case -1: fprintf(stderr, Name "cannot run mdmon. " ++ "Array remains readonly\n"); ++ return -1; ++ default: /* parent - good */ ++ pid = wait(&status); ++ if (pid >= 0 && status == 0) ++ return 0; ++ } ++ ++ /* That failed, try running mdmon directly */ + switch(fork()) { + case 0: + /* FIXME yuk. CLOSE_EXEC?? */ +-- +1.7.11.7 + diff --git a/SOURCES/mdadm-3.2.6-Add-updating-component_size-to-manager-thread-of-mdm.patch b/SOURCES/mdadm-3.2.6-Add-updating-component_size-to-manager-thread-of-mdm.patch new file mode 100644 index 0000000..bc51a39 --- /dev/null +++ b/SOURCES/mdadm-3.2.6-Add-updating-component_size-to-manager-thread-of-mdm.patch @@ -0,0 +1,49 @@ +From 4edb8530e889fc7b5e1b5471a0fbfd6c3c116b4a Mon Sep 17 00:00:00 2001 +From: Pawel Baldysiak +Date: Wed, 3 Apr 2013 12:43:42 +1100 +Subject: [PATCH] Add updating component_size to manager thread of mdmon + +Mdmon does not update component_size now. It is wrong because in case +of size's expansion component_size is changed by mdadm but mdmon does not +reread its new value and uses a wrong, old one. As a result the metadata +is incorrect during size's expansion. It contains no information that +resync is in progress (there is no checkpoint too). The metadata is +as if resync has already been finished but it has not. + +Component_size will be set to match information in sysfs. This value +will be updated by manager thread in manage_member() function. +Now mdmon uses the correct, current value of component_size and the +correct metadata (containing information about resync and checkpoint) +is written. + +Signed-off-by: Pawel Baldysiak +Signed-off-by: NeilBrown +--- + managemon.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/managemon.c b/managemon.c +index d155b04..2c55b3c 100644 +--- a/managemon.c ++++ b/managemon.c +@@ -444,6 +444,7 @@ static void manage_member(struct mdstat_ent *mdstat, + char buf[64]; + int frozen; + struct supertype *container = a->container; ++ unsigned long long int component_size = 0; + + if (container == NULL) + /* Raced with something */ +@@ -453,6 +454,9 @@ static void manage_member(struct mdstat_ent *mdstat, + a->info.array.raid_disks = mdstat->raid_disks; + // MORE + ++ if (sysfs_get_ll(&a->info, NULL, "component_size", &component_size) >= 0) ++ a->info.component_size = component_size << 1; ++ + /* honor 'frozen' */ + if (sysfs_get_str(&a->info, NULL, "metadata_version", buf, sizeof(buf)) > 0) + frozen = buf[9] == '-'; +-- +1.8.1.4 + diff --git a/SOURCES/mdadm-3.2.6-Create.c-check-if-freesize-is-equal-0.patch b/SOURCES/mdadm-3.2.6-Create.c-check-if-freesize-is-equal-0.patch new file mode 100644 index 0000000..59ad001 --- /dev/null +++ b/SOURCES/mdadm-3.2.6-Create.c-check-if-freesize-is-equal-0.patch @@ -0,0 +1,30 @@ +From 066e92f017df22c879c455494d2c1743ef7f3aca Mon Sep 17 00:00:00 2001 +From: Lukasz Dorau +Date: Fri, 16 Nov 2012 17:24:36 +0100 +Subject: [PATCH] Create.c: check if freesize is equal 0 + +"freesize" can be equal 0, particularly after rounding to the chunk's size. +Creating should be aborted in such case. + +Signed-off-by: Lukasz Dorau +Signed-off-by: NeilBrown +--- + Create.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Create.c b/Create.c +index afcf1a5..436bd1d 100644 +--- a/Create.c ++++ b/Create.c +@@ -407,6 +407,11 @@ + do_default_chunk = 0; + } + } ++ if (!freesize) { ++ fprintf(stderr, Name ": no free space left on %s\n", dname); ++ fail = 1; ++ continue; ++ } + + if (size && freesize < size) { + fprintf(stderr, Name ": %s is smaller than given size." diff --git a/SOURCES/mdadm-3.2.6-In-case-launching-mdmon-fails-print-an-error-message.patch b/SOURCES/mdadm-3.2.6-In-case-launching-mdmon-fails-print-an-error-message.patch new file mode 100644 index 0000000..b9dd836 --- /dev/null +++ b/SOURCES/mdadm-3.2.6-In-case-launching-mdmon-fails-print-an-error-message.patch @@ -0,0 +1,32 @@ +From 15c10423aa9435ed72bd292fecca69224a20fdc8 Mon Sep 17 00:00:00 2001 +From: Jes Sorensen +Date: Fri, 1 Feb 2013 16:15:19 +0100 +Subject: [PATCH 3/4] In case launching mdmon fails, print an error message + before exiting + +Signed-off-by: Jes Sorensen +Signed-off-by: NeilBrown +--- + util.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/util.c b/util.c +index 01af0b5..8817a3e 100644 +--- a/util.c ++++ b/util.c +@@ -1709,8 +1709,11 @@ int start_mdmon(int devnum) + return -1; + default: /* parent - good */ + pid = wait(&status); +- if (pid < 0 || status != 0) ++ if (pid < 0 || status != 0) { ++ fprintf(stderr, Name "failed to launch mdmon. " ++ "Array remains readonly\n"); + return -1; ++ } + } + return 0; + } +-- +1.7.11.7 + diff --git a/SOURCES/mdadm-3.2.6-Manage_runstop-call-flush_mdmon-if-O_EXCL-fails-on-s.patch b/SOURCES/mdadm-3.2.6-Manage_runstop-call-flush_mdmon-if-O_EXCL-fails-on-s.patch new file mode 100644 index 0000000..a13e8fa --- /dev/null +++ b/SOURCES/mdadm-3.2.6-Manage_runstop-call-flush_mdmon-if-O_EXCL-fails-on-s.patch @@ -0,0 +1,54 @@ +From 2fdf559d74a48806900b63f1b4504a18dec048a9 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Mon, 22 Apr 2013 17:05:33 +1000 +Subject: [PATCH] Manage_runstop: call flush_mdmon if O_EXCL fails on stopping + mdmon array. + +When stopping an mdmon array, at reshape might be being aborted +which inhibets O_EXCL. So if that is possible, call flush_mdmon +to make sure mdmon isn't still busy. + +Reported-by: Pawel Baldysiak +Signed-off-by: NeilBrown +--- + Manage.c | 29 ++++++++++++++++++++++++----- + 1 file changed, 24 insertions(+), 5 deletions(-) + +diff --git a/Manage.c b/Manage.c +index e3d3041..e37f415 100644 +--- a/Manage.c ++++ b/Manage.c +@@ -221,8 +222,19 @@ int Manage_runstop(char *devname, int fd, int runstop, + /* Get EXCL access first. If this fails, then attempting + * to stop is probably a bad idea. + */ +- close(fd); +- fd = open(devname, O_RDONLY|O_EXCL); ++ mdi = sysfs_read(fd, -1, GET_LEVEL|GET_VERSION); ++ close(fd); ++ count = 5; ++ while (((fd = open(devname, O_RDONLY|O_EXCL)) < 0 ++ || fd2devnum(fd) != devnum) ++ && mdi && !is_subarray(mdi->text_version) ++ && mdmon_running(devname2devnum(mdi->sys_name)) ++ && count) { ++ if (fd >= 0) ++ close(fd); ++ flush_mdmon(mdi->sys_name); ++ count--; ++ } + if (fd < 0 || fd2devnum(fd) != devnum) { + if (fd >= 0) + close(fd); +@@ -237,7 +257,6 @@ int Manage_runstop(char *devname, int fd, int runstop, + devname); + return 1; + } +- mdi = sysfs_read(fd, -1, GET_LEVEL|GET_VERSION); + if (mdi && + mdi->array.level > 0 && + is_subarray(mdi->text_version)) { + +-- +1.8.3.1 + diff --git a/SOURCES/mdadm-3.2.6-Remove-offroot-argument-and-default-to-always-settin.patch b/SOURCES/mdadm-3.2.6-Remove-offroot-argument-and-default-to-always-settin.patch new file mode 100644 index 0000000..66975dc --- /dev/null +++ b/SOURCES/mdadm-3.2.6-Remove-offroot-argument-and-default-to-always-settin.patch @@ -0,0 +1,214 @@ +From 3e23ba9d7bd3c2a9fbddc286014480672763e563 Mon Sep 17 00:00:00 2001 +From: Jes Sorensen +Date: Fri, 1 Feb 2013 16:15:17 +0100 +Subject: [PATCH 1/4] Remove --offroot argument and default to always setting + argv[0] to @ + +We still allow --offroot to be given - for compatibility with scripts +- but ignore it. + +The whole point of --offroot is to get systemd to not auto-kill mdmon, +and we always want that. + +Signed-off-by: Jes Sorensen +Signed-off-by: NeilBrown +--- + ReadMe.c | 4 ---- + mdadm.8.in | 11 ----------- + mdadm.c | 15 ++++++++------- + mdadm.h | 2 -- + mdmon.8 | 11 +---------- + mdmon.c | 14 ++++++-------- + util.c | 13 ++----------- + 7 files changed, 17 insertions(+), 53 deletions(-) + +diff --git a/ReadMe.c b/ReadMe.c +index 4214cb0..c4bb730 100644 +--- a/ReadMe.c ++++ b/ReadMe.c +@@ -259,10 +259,6 @@ char OptionHelp[] = + " --query -Q : Display general information about how a\n" + " device relates to the md driver\n" + " --auto-detect : Start arrays auto-detected by the kernel\n" +-" --offroot : Set first character of argv[0] to @ to indicate the\n" +-" application was launched from initrd/initramfs and\n" +-" should not be shutdown by systemd as part of the\n" +-" regular shutdown process.\n" + ; + /* + "\n" +diff --git a/mdadm.8.in b/mdadm.8.in +index c1881cd..a3abc2d 100644 +--- a/mdadm.8.in ++++ b/mdadm.8.in +@@ -255,17 +255,6 @@ Avoid printing purely informative messages. With this, + .I mdadm + will be silent unless there is something really important to report. + +-.TP +-.BR \-\-offroot +-Set first character of argv[0] to @ to indicate mdadm was launched +-from initrd/initramfs and should not be shutdown by systemd as part of +-the regular shutdown process. This option is normally only used by +-the system's initscripts. Please see here for more details on how +-systemd handled argv[0]: +-.IP +-.B http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons +-.PP +- + + .TP + .BR \-f ", " \-\-force +diff --git a/mdadm.c b/mdadm.c +index 26e8cec..f22fd7b 100644 +--- a/mdadm.c ++++ b/mdadm.c +@@ -116,6 +116,13 @@ int main(int argc, char *argv[]) + ident.container = NULL; + ident.member = NULL; + ++ /* ++ * set first char of argv[0] to @. This is used by ++ * systemd to signal that the task was launched from ++ * initrd/initramfs and should be preserved during shutdown ++ */ ++ argv[0][0] = '@'; ++ + while ((option_index = -1) , + (opt=getopt_long(argc, argv, + shortopt, long_options, +@@ -159,14 +166,8 @@ int main(int argc, char *argv[]) + homehost = optarg; + continue; + +- /* +- * --offroot sets first char of argv[0] to @. This is used +- * by systemd to signal that the tast was launched from +- * initrd/initramfs and should be preserved during shutdown +- */ + case OffRootOpt: +- argv[0][0] = '@'; +- __offroot = 1; ++ /* Silently ignore old option */ + continue; + + case Prefer: +diff --git a/mdadm.h b/mdadm.h +index be760d2..a761f29 100644 +--- a/mdadm.h ++++ b/mdadm.h +@@ -1487,5 +1487,3 @@ char *xstrdup(const char *str); + * v1.x can support 1920 + */ + #define MAX_DISKS 4096 +- +-extern int __offroot; +diff --git a/mdmon.8 b/mdmon.8 +index 598d904..559dd90 100644 +--- a/mdmon.8 ++++ b/mdmon.8 +@@ -5,7 +5,7 @@ mdmon \- monitor MD external metadata arrays + + .SH SYNOPSIS + +-.BI mdmon " [--all] [--takeover] [--offroot] CONTAINER" ++.BI mdmon " [--all] [--takeover] CONTAINER" + + .SH OVERVIEW + The 2.6.27 kernel brings the ability to support external metadata arrays. +@@ -166,15 +166,6 @@ containers with names longer than 5 characters, this argument can be + arbitrarily extended, e.g. to + .BR \-\-all-active-arrays . + .TP +-.BR \-\-offroot +-Set first character of argv[0] to @ to indicate mdmon was launched +-from initrd/initramfs and should not be shutdown by systemd as part of +-the regular shutdown process. This option is normally only used by +-the system's initscripts. Please see here for more details on how +-systemd handled argv[0]: +-.IP +-.B http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons +-.PP + + .PP + Note that +diff --git a/mdmon.c b/mdmon.c +index 5d5ae94..8720aa5 100644 +--- a/mdmon.c ++++ b/mdmon.c +@@ -184,9 +184,6 @@ static void try_kill_monitor(pid_t pid, char *devname, int sock) + buf[sizeof(buf)-1] = 0; + close(fd); + +- /* Note that if started with --offroot, the name +- * might be "@dmon" +- */ + if (n < 0 || !(strstr(buf, "mdmon") || + strstr(buf, "@dmon"))) + return; +@@ -276,10 +273,6 @@ void usage(void) + " --help -h : This message\n" + " --all : All devices\n" + " --takeover -t : Takeover container\n" +-" --offroot : Set first character of argv[0] to @ to indicate the\n" +-" application was launched from initrd/initramfs and\n" +-" should not be shutdown by systemd as part of the\n" +-" regular shutdown process.\n" + ); + exit(2); + } +@@ -303,6 +296,11 @@ int main(int argc, char *argv[]) + {NULL, 0, NULL, 0} + }; + ++ /* ++ * Always change process name to @dmon to avoid systemd killing it ++ */ ++ argv[0][0] = '@'; ++ + while ((opt = getopt_long(argc, argv, "tha", options, NULL)) != -1) { + switch (opt) { + case 'a': +@@ -313,7 +311,7 @@ int main(int argc, char *argv[]) + takeover = 1; + break; + case OffRootOpt: +- argv[0][0] = '@'; ++ /* silently ignore old option */ + break; + case 'h': + default: +diff --git a/util.c b/util.c +index fc9043b..e75b754 100644 +--- a/util.c ++++ b/util.c +@@ -32,8 +32,6 @@ + #include + #include + +-int __offroot; +- + /* + * following taken from linux/blkpg.h because they aren't + * anywhere else and it isn't safe to #include linux/ * stuff. +@@ -1674,15 +1672,8 @@ int start_mdmon(int devnum) + + for (i=0; paths[i]; i++) + if (paths[i][0]) { +- if (__offroot) { +- execl(paths[i], "mdmon", "--offroot", +- devnum2devname(devnum), +- NULL); +- } else { +- execl(paths[i], "mdmon", +- devnum2devname(devnum), +- NULL); +- } ++ execl(paths[i], "mdmon", ++ devnum2devname(devnum), NULL); + } + exit(1); + case -1: fprintf(stderr, Name ": cannot run mdmon. " +-- +1.7.11.7 + diff --git a/SOURCES/mdadm-3.2.6-imsm-Forbid-spanning-between-multiple-controllers.patch b/SOURCES/mdadm-3.2.6-imsm-Forbid-spanning-between-multiple-controllers.patch new file mode 100644 index 0000000..b5959ae --- /dev/null +++ b/SOURCES/mdadm-3.2.6-imsm-Forbid-spanning-between-multiple-controllers.patch @@ -0,0 +1,73 @@ +From 3c309c82699ae3bebc716dbd5abea079dd41184a Mon Sep 17 00:00:00 2001 +From: Marcin Tomczak +Date: Fri, 9 Nov 2012 15:46:36 +0100 +Subject: [PATCH] imsm: Forbid spanning between multiple controllers. + +Attaching disks to multiple controllers of the same type has been +allowed so far. Now spanning between multiple controllers is disallowed +at all by IMSM metadata. + +Signed-off-by: Marcin Tomczak +Reviewed-by: Lukasz Dorau +Signed-off-by: NeilBrown +--- + super-intel.c | 25 ++++++++----------------- + 1 file changed, 8 insertions(+), 17 deletions(-) + +diff --git a/super-intel.c b/super-intel.c +index 202b83f..4ac9d42 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -558,20 +558,11 @@ static int attach_hba_to_super(struct intel_super *super, struct sys_dev *device + if (super->hba == NULL) { + super->hba = alloc_intel_hba(device); + return 1; +- } +- +- hba = super->hba; +- /* Intel metadata allows for all disks attached to the same type HBA. +- * Do not sypport odf HBA types mixing +- */ +- if (device->type != hba->type) ++ } else ++ /* IMSM metadata disallows to attach disks to multiple ++ * controllers. ++ */ + return 2; +- +- while (hba->next) +- hba = hba->next; +- +- hba->next = alloc_intel_hba(device); +- return 1; + } + + static struct sys_dev* find_disk_attached_hba(int fd, const char *devname) +@@ -3073,11 +3064,11 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst) + */ + if (!check_env("IMSM_NO_PLATFORM")) { +- if (!first->hba || !sec->hba || +- (first->hba->type != sec->hba->type)) { ++ if (first->hba && sec->hba && ++ strcmp(first->hba->path, sec->hba->path) != 0) { + fprintf(stderr, + "HBAs of devices does not match %s != %s\n", +- first->hba ? get_sys_dev_type(first->hba->type) : NULL, +- sec->hba ? get_sys_dev_type(sec->hba->type) : NULL); ++ first->hba ? first->hba->path : NULL, ++ sec->hba ? sec->hba->path : NULL); + return 3; + } + } +@@ -3819,7 +3810,7 @@ static int find_intel_hba_capability(int fd, struct intel_super *super, char *de + } + + fprintf(stderr, ").\n" +- " Mixing devices attached to different controllers " ++ " Mixing devices attached to multiple controllers " + "is not allowed.\n"); + } + free_sys_dev(&hba_name); +-- +1.7.11.7 + diff --git a/SOURCES/mdadm-3.2.6-imsm-monitor-do-not-finish-migration-if-there-are-no.patch b/SOURCES/mdadm-3.2.6-imsm-monitor-do-not-finish-migration-if-there-are-no.patch new file mode 100644 index 0000000..202f61e --- /dev/null +++ b/SOURCES/mdadm-3.2.6-imsm-monitor-do-not-finish-migration-if-there-are-no.patch @@ -0,0 +1,49 @@ +From 79b68f1b48b0967da999945e310aef628c9bca4c Mon Sep 17 00:00:00 2001 +From: Przemyslaw Czarnowski +Date: Thu, 18 Apr 2013 10:51:37 +0200 +Subject: [PATCH] imsm: monitor: do not finish migration if there are no failed + disks + +Transition from "degraded" to "recovery" made in OROM is slightly different +than the same transision in mdadm. Missing disk is not removed from list of +raid devices, but just from map. Therefore mdadm should not end migration +basing on existence of list of missing disks but should rely on count of +failed disks. + +Signed-off-by: Przemyslaw Czarnowski +Tested-by: Pawel Baldysiak +Signed-off-by: NeilBrown +--- + super-intel.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/super-intel.c b/super-intel.c +index 24016b7..3f15b0f 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -6886,6 +6886,12 @@ static void handle_missing(struct intel_super *super, struct imsm_dev *dev) + if (!super->missing) + return; + ++ /* When orom adds replacement for missing disk it does ++ * not remove entry of missing disk, but just updates map with ++ * new added disk. So it is not enough just to test if there is ++ * any missing disk, we have to look if there are any failed disks ++ * in map to stop migration */ ++ + dprintf("imsm: mark missing\n"); + /* end process for initialization and rebuild only + */ +@@ -6896,7 +6902,8 @@ static void handle_missing(struct intel_super *super, struct imsm_dev *dev) + failed = imsm_count_failed(super, dev, MAP_0); + map_state = imsm_check_degraded(super, dev, failed, MAP_0); + +- end_migration(dev, super, map_state); ++ if (failed) ++ end_migration(dev, super, map_state); + } + for (dl = super->missing; dl; dl = dl->next) + mark_missing(dev, &dl->disk, dl->index); +-- +1.8.1.4 + diff --git a/SOURCES/mdadm-3.2.6-mdmon-add-foreground-option.patch b/SOURCES/mdadm-3.2.6-mdmon-add-foreground-option.patch new file mode 100644 index 0000000..36ce25e --- /dev/null +++ b/SOURCES/mdadm-3.2.6-mdmon-add-foreground-option.patch @@ -0,0 +1,106 @@ +From 030419821fb77f9955f2017b4a6d3d8139d6db25 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Tue, 5 Feb 2013 15:57:09 +1100 +Subject: [PATCH 4/4] mdmon: add --foreground option + +While not strictly necessary for systemd, it is cleaner to avoid +forking when running from a management daemon. So add a --foreground +option to mdmon. + +Signed-off-by: NeilBrown +--- + mdmon.8 | 10 +++++++++- + mdmon.c | 9 +++++++-- + systemd/mdmon@.service | 2 +- + 3 files changed, 17 insertions(+), 4 deletions(-) + +diff --git a/mdmon.8 b/mdmon.8 +index 559dd90..a968cdb 100644 +--- a/mdmon.8 ++++ b/mdmon.8 +@@ -5,7 +5,7 @@ mdmon \- monitor MD external metadata arrays + + .SH SYNOPSIS + +-.BI mdmon " [--all] [--takeover] CONTAINER" ++.BI mdmon " [--all] [--takeover] [--foreground] CONTAINER" + + .SH OVERVIEW + The 2.6.27 kernel brings the ability to support external metadata arrays. +@@ -131,6 +131,14 @@ The + device to monitor. It can be a full path like /dev/md/container, or a + simple md device name like md127. + .TP ++.B \-\-foreground ++Normally, ++.I mdmon ++will fork and continue in the background. Adding this option will ++skip that step and run ++.I mdmon ++in the foreground. ++.TP + .B \-\-takeover + This instructs + .I mdmon +diff --git a/mdmon.c b/mdmon.c +index 8720aa5..007071b 100644 +--- a/mdmon.c ++++ b/mdmon.c +@@ -288,11 +288,13 @@ int main(int argc, char *argv[]) + int opt; + int all = 0; + int takeover = 0; ++ int dofork = 1; + static struct option options[] = { + {"all", 0, NULL, 'a'}, + {"takeover", 0, NULL, 't'}, + {"help", 0, NULL, 'h'}, + {"offroot", 0, NULL, OffRootOpt}, ++ {"foreground", 0, NULL, 'F'}, + {NULL, 0, NULL, 0} + }; + +@@ -301,7 +303,7 @@ int main(int argc, char *argv[]) + */ + argv[0][0] = '@'; + +- while ((opt = getopt_long(argc, argv, "tha", options, NULL)) != -1) { ++ while ((opt = getopt_long(argc, argv, "thaF", options, NULL)) != -1) { + switch (opt) { + case 'a': + container_name = argv[optind-1]; +@@ -310,6 +312,9 @@ int main(int argc, char *argv[]) + case 't': + takeover = 1; + break; ++ case 'F': ++ dofork = 0; ++ break; + case OffRootOpt: + /* silently ignore old option */ + break; +@@ -381,7 +386,7 @@ int main(int argc, char *argv[]) + container_name); + exit(1); + } +- return mdmon(devname, devnum, do_fork(), takeover); ++ return mdmon(devname, devnum, dofork && do_fork(), takeover); + } + + static int mdmon(char *devname, int devnum, int must_fork, int takeover) +diff --git a/systemd/mdmon@.service b/systemd/mdmon@.service +index ddb475f..809f527 100644 +--- a/systemd/mdmon@.service ++++ b/systemd/mdmon@.service +@@ -11,7 +11,7 @@ DefaultDependencies=no + Before=initrd-switch-root.target + + [Service] +-ExecStart=/sbin/mdmon %I ++ExecStart=/sbin/mdmon --foreground %I + StandardInput=null + StandardOutput=null + StandardError=null +-- +1.7.11.7 + diff --git a/SOURCES/mdadm-3.2.6-query-udev-dir-via-pkg-config.patch b/SOURCES/mdadm-3.2.6-query-udev-dir-via-pkg-config.patch new file mode 100644 index 0000000..874c403 --- /dev/null +++ b/SOURCES/mdadm-3.2.6-query-udev-dir-via-pkg-config.patch @@ -0,0 +1,54 @@ +From fa0d79e2b2642a2f8b04d34dfef866dbabc69e1e Mon Sep 17 00:00:00 2001 +From: Samuli Suominen +Date: Mon, 13 Aug 2012 13:44:22 -0400 +Subject: [PATCH] query udev dir via pkg-config + +Since udev is moving its internal dir around, query it via pkg-config +rather than hardcoding the old path. This should work with new/old +versions. + +Signed-off-by: Samuli Suominen +Signed-off-by: Mike Frysinger +Signed-off-by: NeilBrown +--- + Makefile | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 72f609e..a3e4027 100644 +--- a/Makefile ++++ b/Makefile +@@ -57,6 +57,8 @@ else + DEFAULT_METADATA=1.2 + endif + ++PKG_CONFIG ?= pkg-config ++ + SYSCONFDIR = /etc + CONFFILE = $(SYSCONFDIR)/mdadm.conf + CONFFILE2 = $(SYSCONFDIR)/mdadm/mdadm.conf +@@ -96,6 +98,11 @@ MAN4DIR = $(MANDIR)/man4 + MAN5DIR = $(MANDIR)/man5 + MAN8DIR = $(MANDIR)/man8 + ++UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null) ++ifndef UDEVDIR ++ UDEVDIR = /lib/udev ++endif ++ + OBJS = mdadm.o config.o policy.o mdstat.o ReadMe.o util.o maps.o lib.o \ + Manage.o Assemble.o Build.o \ + Create.o Detail.o Examine.o Grow.o Monitor.o dlink.o Kill.o Query.o \ +@@ -255,7 +262,7 @@ install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8 + $(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 + + install-udev: udev-md-raid.rules +- $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules ++ $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)$(UDEVDIR)/rules.d/64-md-raid.rules + + uninstall: + rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm + +-- +1.8.1.4 + diff --git a/SOURCES/mdadm-3.2.6-udev.patch b/SOURCES/mdadm-3.2.6-udev.patch new file mode 100644 index 0000000..a2084ce --- /dev/null +++ b/SOURCES/mdadm-3.2.6-udev.patch @@ -0,0 +1,32 @@ +--- mdadm-3.2.3/udev-md-raid.rules.udev 2011-12-15 05:13:08.000000000 +0100 ++++ mdadm-3.2.3/udev-md-raid.rules 2011-12-28 17:18:02.753053345 +0100 +@@ -2,19 +2,21 @@ + + SUBSYSTEM!="block", GOTO="md_end" + ++# In Fedora we handle the raid components in 65-md-incremental.rules so that ++# we can do things like honor anaconda command line options and such + # handle potential components of arrays (the ones supported by md) +-ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_inc" +-GOTO="md_inc_skip" +- +-LABEL="md_inc" ++#ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_inc" ++#GOTO="md_inc_skip" ++# ++#LABEL="md_inc" + + # remember you can limit what gets auto/incrementally assembled by + # mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY' +-ACTION=="add", RUN+="/sbin/mdadm --incremental $tempnode --offroot" +-ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" +-ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/sbin/mdadm -If $name" ++#ACTION=="add", RUN+="/sbin/mdadm --incremental $tempnode --offroot" ++#ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" ++#ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/sbin/mdadm -If $name" + +-LABEL="md_inc_skip" ++#LABEL="md_inc_skip" + + # handle md arrays + ACTION!="add|change", GOTO="md_end" diff --git a/SOURCES/mdadm-cron b/SOURCES/mdadm-cron new file mode 100644 index 0000000..4e05d68 --- /dev/null +++ b/SOURCES/mdadm-cron @@ -0,0 +1,3 @@ +# Run system wide raid-check once a week on Sunday at 1am by default +0 1 * * Sun root /usr/sbin/raid-check + diff --git a/SOURCES/mdadm-raid-check-sysconfig b/SOURCES/mdadm-raid-check-sysconfig new file mode 100644 index 0000000..8e82270 --- /dev/null +++ b/SOURCES/mdadm-raid-check-sysconfig @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Configuration file for /etc/cron.weekly/raid-check +# +# options: +# ENABLED - must be yes in order for the raid check to proceed +# CHECK - can be either check or repair depending on the type of +# operation the user desires. A check operation will scan +# the drives looking for bad sectors and automatically +# repairing only bad sectors. If it finds good sectors that +# contain bad data (meaning that the data in a sector does +# not agree with what the data from another disk indicates +# the data should be, for example the parity block + the other +# data blocks would cause us to think that this data block +# is incorrect), then it does nothing but increments the +# counter in the file /sys/block/$dev/md/mismatch_count. +# This allows the sysadmin to inspect the data in the sector +# and the data that would be produced by rebuilding the +# sector from redundant information and pick the correct +# data to keep. The repair option does the same thing, but +# when it encounters a mismatch in the data, it automatically +# updates the data to be consistent. However, since we really +# don't know whether it's the parity or the data block that's +# correct (or which data block in the case of raid1), it's +# luck of the draw whether or not the user gets the right +# data instead of the bad data. This option is the default +# option for devices not listed in either CHECK_DEVS or +# REPAIR_DEVS. +# CHECK_DEVS - a space delimited list of devs that the user specifically +# wants to run a check operation on. +# REPAIR_DEVS - a space delimited list of devs that the user +# specifically wants to run a repair on. +# SKIP_DEVS - a space delimited list of devs that should be skipped +# NICE - Change the raid check CPU and IO priority in order to make +# the system more responsive during lengthy checks. Valid +# values are high, normal, low, idle. +# MAXCONCURENT - Limit the number of devices to be checked at a time. +# By default all devices will be checked at the same time. +# +# Note: the raid-check script intentionaly runs last in the cron.weekly +# sequence. This is so we can wait for all the resync operations to complete +# and then check the mismatch_count on each array without unduly delaying +# other weekly cron jobs. If any arrays have a non-0 mismatch_count after +# the check completes, we echo a warning to stdout which will then me emailed +# to the admin as long as mails from cron jobs have not been redirected to +# /dev/null. We do not wait for repair operations to complete as the +# md stack will correct any mismatch_cnts automatically. +# +# Note2: you can not use symbolic names for the raid devices, such as you +# /dev/md/root. The names used in this file must match the names seen in +# /proc/mdstat and in /sys/block. + +ENABLED=yes +CHECK=check +NICE=low +# To check devs /dev/md0 and /dev/md3, use "md0 md3" +CHECK_DEVS="" +REPAIR_DEVS="" +SKIP_DEVS="" +MAXCONCURRENT= diff --git a/SOURCES/mdadm.conf b/SOURCES/mdadm.conf new file mode 100644 index 0000000..6200117 --- /dev/null +++ b/SOURCES/mdadm.conf @@ -0,0 +1 @@ +d /var/run/mdadm 0710 root root - diff --git a/SOURCES/mdadm.rules b/SOURCES/mdadm.rules new file mode 100644 index 0000000..73e9c83 --- /dev/null +++ b/SOURCES/mdadm.rules @@ -0,0 +1,76 @@ +# This file causes block devices with Linux RAID (mdadm) signatures to +# automatically cause mdadm to be run. +# See udev(8) for syntax + +# Don't process any events if anaconda is running as anaconda brings up +# raid devices manually +ENV{ANACONDA}=="?*", GOTO="md_end" + +# Also don't process disks that are slated to be a multipath device +ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="md_end" + +# We process add events on block devices (since they are ready as soon as +# they are added to the system), but we must process change events as well +# on any dm devices (like LUKS partitions or LVM logical volumes) and on +# md devices because both of these first get added, then get brought live +# and trigger a change event. The reason we don't process change events +# on bare hard disks is because if you stop all arrays on a disk, then +# run fdisk on the disk to change the partitions, when fdisk exits it +# triggers a change event, and we want to wait until all the fdisks on +# all member disks are done before we do anything. Unfortunately, we have +# no way of knowing that, so we just have to let those arrays be brought +# up manually after fdisk has been run on all of the disks. + +# First, process all add events (md and dm devices will not really do +# anything here, just regular disks, and this also won't get any imsm +# array members either) +SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \ + RUN+="/sbin/mdadm -I $env{DEVNAME}" +SUBSYSTEM=="block", ACTION=="remove", ENV{ID_PATH}=="?*", \ + ENV{ID_FS_TYPE}=="linux_raid_member", \ + RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" +SUBSYSTEM=="block", ACTION=="remove", ENV{ID_PATH}!="?*", \ + ENV{ID_FS_TYPE}=="linux_raid_member", \ + RUN+="/sbin/mdadm -If $name" + +# Next, check to make sure the BIOS raid stuff wasn't turned off via cmdline +IMPORT{cmdline}="noiswmd" +IMPORT{cmdline}="nodmraid" +ENV{noiswmd}=="?*", GOTO="md_imsm_inc_end" +ENV{nodmraid}=="?*", GOTO="md_imsm_inc_end" +SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="isw_raid_member", \ + RUN+="/sbin/mdadm -I $env{DEVNAME}" +SUBSYSTEM=="block", ACTION=="remove", ENV{ID_PATH}=="?*", \ + ENV{ID_FS_TYPE}=="isw_raid_member", \ + RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" +SUBSYSTEM=="block", ACTION=="remove", ENV{ID_PATH}!="?*", \ + ENV{ID_FS_TYPE}=="isw_raid_member", \ + RUN+="/sbin/mdadm -If $name" +LABEL="md_imsm_inc_end" + +# Next make sure that this isn't a dm device we should skip for some reason +ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_change_end" +ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_change_end" +ENV{DM_SUSPENDED}=="1", GOTO="dm_change_end" +KERNEL=="dm-*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \ + ACTION=="change", RUN+="/sbin/mdadm -I $env{DEVNAME}" +LABEL="dm_change_end" + +# Finally catch any nested md raid arrays. If we brought up an md raid +# array that's part of another md raid array, it won't be ready to be used +# until the change event that occurs when it becomes live +KERNEL=="md*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \ + ACTION=="change", RUN+="/sbin/mdadm -I $env{DEVNAME}" + +# In case the initramfs only started some of the arrays in our container, +# run incremental assembly on the container itself. Note: we ran mdadm +# on the container in 64-md-raid.rules, and that's how the MD_LEVEL +# environment variable is already set. If that disappears from the other +# file, we will need to add this line into the middle of the next rule: +# IMPORT{program}="/sbin/mdadm -D --export $tempnode", \ + +SUBSYSTEM=="block", ACTION=="add|change", KERNEL=="md*", \ + ENV{MD_LEVEL}=="container", RUN+="/sbin/mdadm -I $env{DEVNAME}" + + +LABEL="md_end" diff --git a/SOURCES/mdadm_event.conf b/SOURCES/mdadm_event.conf new file mode 100644 index 0000000..1a6c479 --- /dev/null +++ b/SOURCES/mdadm_event.conf @@ -0,0 +1,5 @@ +# Save /proc/mdstat in case of crash in mdadm/mdmon + +EVENT=post-create component=mdadm + cat /proc/mdstat >> mdstat_data + echo "Saved output of /proc/mdstat" diff --git a/SOURCES/mdmonitor.init b/SOURCES/mdmonitor.init new file mode 100755 index 0000000..03f3e95 --- /dev/null +++ b/SOURCES/mdmonitor.init @@ -0,0 +1,118 @@ +#!/bin/bash +# +# mdmonitor This starts, stops, and reloads the mdadm-based +# software RAID monitoring and management facility +# +# chkconfig: 2345 15 85 +# description: software RAID monitoring and management +# config: /etc/mdadm.conf +# +# Copyright 2002 Red Hat, Inc. +# +### BEGIN INIT INFO +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start and stop the MD software RAID monitor +# Description: The mdmonitor service checks the status of all software +# RAID arrays on the system. In the event that any of the arrays +# transition into a degraded state, it notifies the system +# administrator. Other options are available, see the mdadm.conf +# and mdadm man pages for possible ways to configure this service. +### END INIT INFO + +PIDPATH=/var/run/mdadm +PIDFILE=/var/run/mdadm/mdadm.pid +PATH=/sbin:/usr/sbin:$PATH +RETVAL=0 +OPTIONS="--monitor --scan -f --pid-file=$PIDFILE" + +prog=mdmonitor + +# Source function library. +. /etc/rc.d/init.d/functions + + +usage () +{ + echo "Usage: service $prog {start|stop|status|restart|try-restart|force-reload}" + RETVAL=1 +} + + +start () +{ +# (Re)start mdmon to take over monitoring of mdmon started from the initrd + for i in /dev/md/*.pid; do + if [ -r $i ]; then + origprog="$prog"; prog="mdmon" + action $"Starting $prog: " /sbin/mdmon --takeover --all + prog="$origprog" + break + fi + done +# Make sure configuration file exists and has information we can use +# MAILADDR or PROGRAM or both must be set in order to run mdadm --monitor + [ -f /etc/mdadm.conf ] || return 6 + grep '^\(MAILADDR\|PROGRAM\) .' /etc/mdadm.conf >/dev/null 2>&1 || return 6 + # Create our directory if it isn't there yet + if [ ! -d $PIDPATH ]; then + mkdir -m 0700 $PIDPATH >&/dev/null + RC=$? + [ -x /sbin/restorecon ] && /sbin/restorecon $PIDPATH + if [ $RC -ne 0 ]; then + echo -n "Failed to create /var/run/mdadm" + failure + echo + return 1 + fi + fi + if [ -f "$PIDFILE" ]; then + checkpid `cat $PIDFILE` && return 0 + fi + echo -n $"Starting $prog: " + cd / + daemon --user=root mdadm ${OPTIONS} + ret=$? + [ $ret -eq "0" ] && touch /var/lock/subsys/$prog + echo + return $ret +} + +stop () +{ + [ -f /var/lock/subsys/$prog ] || return 0 + echo -n "Killing $prog: " + killproc mdadm + echo + rm -f $PIDFILE + rm -f /var/lock/subsys/$prog +} + +restart () +{ + stop + start +} + +condrestart () +{ + [ -e /var/lock/subsys/$prog ] && restart || return 0 +} + + +case "$1" in + start|stop|restart|condrestart|try-restart|force-reload) + [ `id -u` != "0" ] && exit 4 ;; +esac + +case "$1" in + start) start; RETVAL=$? ;; + stop) stop; RETVAL=$? ;; + status) status -p $PIDFILE $prog ; RETVAL=$? ;; + restart) restart; RETVAL=$? ;; + reload) RETVAL=3 ;; + condrestart|try-restart|force-reload) condrestart; RETVAL=$? ;; + *) usage ; RETVAL=2 ;; +esac + +exit $RETVAL diff --git a/SOURCES/mdmonitor.service b/SOURCES/mdmonitor.service new file mode 100644 index 0000000..8c92f82 --- /dev/null +++ b/SOURCES/mdmonitor.service @@ -0,0 +1,13 @@ +[Unit] +Description=Software RAID monitoring and management +After=syslog.target +ConditionPathExists=/etc/mdadm.conf + +[Service] +Type=forking +PIDFile=/var/run/mdadm/mdadm.pid +EnvironmentFile=-/etc/sysconfig/mdmonitor +ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/raid-check b/SOURCES/raid-check new file mode 100644 index 0000000..7b2fb59 --- /dev/null +++ b/SOURCES/raid-check @@ -0,0 +1,135 @@ +#!/bin/bash +# +# This script reads it's configuration from /etc/sysconfig/raid-check +# Please use that file to enable/disable this script or to set the +# type of check you wish performed. + +# We might be on a kernel with no raid support at all, exit if so +[ -f /proc/mdstat ] || exit 0 + +# and exit if we haven't been set up properly +[ -f /etc/sysconfig/raid-check ] || exit 0 +. /etc/sysconfig/raid-check + +# Wait until no more than arg1 arrays in arg2 list are busy +waitbusy() { + local threshold=$(($1 + 1)) + local dev_list="$2" + while true + do + local busy=0 + local dev="" + for dev in $dev_list; do + local sync_action=`cat /sys/block/$dev/md/sync_action` + if [ "$sync_action" != "idle" ]; then + let busy++ + fi + done + [ $busy -lt $threshold ] && break + sleep 60 + done +} + +[ "$ENABLED" != "yes" ] && exit 0 + +case "$CHECK" in + check) ;; + repair) ;; + *) exit 0;; +esac + +ionice="" +renice="" +case $NICE in + high) + renice="-n -5" + ;; + low) + renice="-n 5" + ionice="-c2 -n7" + ;; + idle) + renice="-n 15" + ionice="-c3" + ;; + *) + ;; +esac + +active_list=`grep "^md.*: active" /proc/mdstat | cut -f 1 -d ' '` +[ -z "$active_list" ] && exit 0 + +declare -A check +dev_list="" +check_list="" +for dev in $active_list; do + echo $SKIP_DEVS | grep -w $dev >&/dev/null && continue + if [ -f /sys/block/$dev/md/sync_action ]; then + # Only perform the checks on idle, healthy arrays, but delay + # actually writing the check field until the next loop so we + # don't switch currently idle arrays to active, which happens + # when two or more arrays are on the same physical disk + array_state=`cat /sys/block/$dev/md/array_state` + if [ "$array_state" != "clean" -a "$array_state" != "active" ]; then + continue + fi + sync_action=`cat /sys/block/$dev/md/sync_action` + if [ "$sync_action" != idle ]; then + continue + fi + ck="" + echo $REPAIR_DEVS | grep -w $dev >&/dev/null && ck="repair" + echo $CHECK_DEVS | grep -w $dev >&/dev/null && ck="check" + [ -z "$ck" ] && ck=$CHECK + dev_list="$dev_list $dev" + check[$dev]=$ck + [ "$ck" = "check" ] && check_list="$check_list $dev" + fi +done +[ -z "$dev_list" ] && exit 0 + +for dev in $dev_list; do + #Only run $MAXCONCURRENT checks at a time + if [ -n "$MAXCONCURRENT" ]; then + waitbusy $((MAXCONCURRENT - 1)) "$dev_list" + fi + echo "${check[$dev]}" > /sys/block/$dev/md/sync_action + + resync_pid="" + wait=10 + while [ $wait -gt 0 -a -z "$resync_pid" ]; do + sleep 6 + let wait-- + resync_pid=$(ps -ef | awk -v mddev=$dev 'BEGIN { pattern = "^\\[" mddev "_resync]$" } $8 ~ pattern { print $2 }') + done + [ -n "$resync_pid" -a -n "$renice" ] && + renice $renice -p $resync_pid >&/dev/null + [ -n "$resync_pid" -a -n "$ionice" ] && + ionice $ionice -p $resync_pid >&/dev/null +done +[ -z "$check_list" ] && exit 0 + +waitbusy 0 "$check_list" + +for dev in $check_list; do + mismatch_cnt=`cat /sys/block/$dev/md/mismatch_cnt` + # Due to the fact that raid1/10 writes in the kernel are unbuffered, + # a raid1 array can have non-0 mismatch counts even when the + # array is healthy. These non-0 counts will only exist in + # transient data areas where they don't pose a problem. However, + # since we can't tell the difference between a non-0 count that + # is just in transient data or a non-0 count that signifies a + # real problem, simply don't check the mismatch_cnt on raid1 + # devices as it's providing far too many false positives. But by + # leaving the raid1 device in the check list and performing the + # check, we still catch and correct any bad sectors there might + # be in the device. + raid_lvl=`cat /sys/block/$dev/md/level` + if [ "$raid_lvl" = "raid1" -o "$raid_lvl" = "raid10" ]; then + continue + fi + if [ "$mismatch_cnt" -ne 0 ]; then + echo "WARNING: mismatch_cnt is not 0 on /dev/$dev" + fi +done + diff --git a/SPECS/mdadm.spec b/SPECS/mdadm.spec new file mode 100644 index 0000000..ed6a0a2 --- /dev/null +++ b/SPECS/mdadm.spec @@ -0,0 +1,935 @@ +Summary: The mdadm program controls Linux md devices (software RAID arrays) +Name: mdadm +Version: 3.2.6 +Release: 22%{?dist} +Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz +Source1: mdmonitor.init +Source2: raid-check +Source3: mdadm.rules +Source4: mdadm-raid-check-sysconfig +Source5: mdadm-cron +Source6: mdmonitor.service +Source7: mdadm.conf +Source8: mdadm_event.conf +Patch1: mdadm-3.2.6-Create.c-check-if-freesize-is-equal-0.patch +Patch2: mdadm-3.2.6-imsm-Forbid-spanning-between-multiple-controllers.patch +Patch3: mdadm-3.2.6-query-udev-dir-via-pkg-config.patch +Patch4: mdadm-3.2.6-Add-updating-component_size-to-manager-thread-of-mdm.patch +Patch5: mdadm-3.2.6-imsm-monitor-do-not-finish-migration-if-there-are-no.patch +Patch6: mdadm-3.2.6-Manage_runstop-call-flush_mdmon-if-O_EXCL-fails-on-s.patch +Patch93: mdadm-3.2.6-Remove-offroot-argument-and-default-to-always-settin.patch +Patch94: mdadm-3.2.6-Add-support-for-launching-mdmon-via-systemctl-instea.patch +Patch95: mdadm-3.2.6-In-case-launching-mdmon-fails-print-an-error-message.patch +Patch96: mdadm-3.2.6-mdmon-add-foreground-option.patch +# Fedora customization patches +Patch97: mdadm-3.2.6-udev.patch +Patch98: mdadm-2.5.2-static.patch +# Fedora 17 - only +Patch99: mdadm-3.2.4-map-dir.patch +URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/ +License: GPLv2+ +Group: System Environment/Base +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Obsoletes: mdctl,raidtools +Obsoletes: mdadm-sysvinit +Conflicts: dracut < 024-25 +Requires(post): systemd-units chkconfig coreutils +BuildRequires: systemd-units binutils-devel +Requires(preun): systemd-units +Requires(postun): systemd-units coreutils +Requires: libreport-filesystem + +%description +The mdadm program is used to create, manage, and monitor Linux MD (software +RAID) devices. As such, it provides similar functionality to the raidtools +package. However, mdadm is a single program, and it can perform +almost all functions without a configuration file, though a configuration +file can be used to help with some common tasks. + +%prep +%setup -q +%patch1 -p1 -b .raidsize +%patch2 -p1 -b .multictrl +%patch3 -p1 -b .udevquery +%patch4 -p1 -b .component +%patch5 -p1 -b .migration +%patch6 -p1 -b .runstop + +# Use systemctl to launch mdmon on F18 and higher +%patch93 -p1 -b .nooffroot +%patch94 -p1 -b .sysctl +%patch95 -p1 -b .mdmonfail +%patch96 -p1 -b .foreground + +# Fedora customization patches +%patch97 -p1 -b .udev +%patch98 -p1 -b .static + +%build +make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" SYSCONFDIR="%{_sysconfdir}" mdadm mdmon + +%install +rm -rf %{buildroot} +make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} install install-systemd +install -Dp -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/raid-check +install -Dp -m 644 %{SOURCE3} %{buildroot}%{_udevrulesdir}/65-md-incremental.rules +install -Dp -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/raid-check +install -Dp -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/cron.d/raid-check +mkdir -p -m 700 %{buildroot}/var/run/mdadm + +# systemd +mkdir -p %{buildroot}%{_unitdir} +install -m644 %{SOURCE6} %{buildroot}%{_unitdir} + +# tmpfile +mkdir -p %{buildroot}%{_tmpfilesdir} +install -m 0644 %{SOURCE7} %{buildroot}%{_tmpfilesdir}/%{name}.conf +mkdir -p %{buildroot}%{_localstatedir}/run/ +install -d -m 0710 %{buildroot}%{_localstatedir}/run/%{name}/ + +# abrt +mkdir -p %{buildroot}/etc/libreport/events.d +install -m644 %{SOURCE8} %{buildroot}/etc/libreport/events.d + +%clean +rm -rf %{buildroot} + +%post +%systemd_post mdmonitor.service +/usr/bin/systemctl disable mdmonitor-takeover.service >/dev/null 2>&1 || : + +%preun +%systemd_preun mdmonitor.service + +%postun +%systemd_postun_with_restart mdmonitor.service + +%triggerun -- %{name} < 3.2.2-3 +%{_bindir}/systemd-sysv-convert --save mdmonitor >/dev/null 2>&1 || : +/bin/systemctl --no-reload enable mdmonitor.service >/dev/null 2>&1 || : +/sbin/chkconfig --del mdmonitor >/dev/null 2>&1 || : +/bin/systemctl try-restart mdmonitor.service >/dev/null 2>&1 || : + +%files +%defattr(-,root,root,-) +%doc TODO ChangeLog mdadm.conf-example COPYING misc/* +%{_udevrulesdir}/* +%{_sbindir}/* +%{_unitdir}/* +%{_mandir}/man*/md* +%config(noreplace) %{_sysconfdir}/cron.d/* +%config(noreplace) %{_sysconfdir}/sysconfig/* +%dir %{_localstatedir}/run/%{name}/ +%config(noreplace) %{_tmpfilesdir}/%{name}.conf +/etc/libreport/events.d/* + +%changelog +* Thu Oct 10 2013 Jes Sorensen - 3.2.6-22 +- Check for DM_UDEV_DISABLE_OTHER_RULES_FLAG instead of + DM_UDEV_DISABLE_DISK_RULES_FLAG in 65-md-incremental.rules +- Resolves bz1015515 + +* Thu Aug 29 2013 Jes Sorensen - 3.2.6-21 +- Fix pointless rpmbuild noise over mismatching date info +- Remove Fedora 17 support +- Fix problem where first stop command doesn't stop container during + IMSM volume's bz956059 + +* Wed Apr 24 2013 Jes Sorensen - 3.2.6-19 +- Fix problem where rebuild of IMSM RAID5 volume started in OROM, + does not proceed in OS +- Resolves bz956021 (f18), bz956026 (f17), bz956031 (f19) + +* Tue Apr 23 2013 Jes Sorensen - 3.2.6-18 +- Fix problem with IMSM metadata where resync progress would be lost + if an array was stopped during ongoing expansion of a RAID1/5 volume. +- Resolves bz948745 + +* Tue Apr 23 2013 Jes Sorensen - 3.2.6-17 +- Reorder patches to allow for udev query patch to be applied on + Fedora 17 as well. + +* Mon Apr 22 2013 Jes Sorensen - 3.2.6-16 +- Rely on rpm macros to place files in correct directories, and match /usr + move +- Resolves bz955248 + +* Thu Mar 7 2013 Jes Sorensen - 3.2.6-15 +- Cleanup .spec file handling of different Fedora versions +- Resolves bz914629 + +* Tue Feb 5 2013 Jes Sorensen - 3.2.6-14 +- Resync with final version of upstream patches for launching mdmon + via systemctl. Require dracut 024-025 or later to match. +- Resolves bz879327 + +* Fri Feb 1 2013 Jes Sorensen - 3.2.6-13 +- Update to upstream solution for launching mdmon via systemctl +- Resolves bz879327 + +* Mon Jan 21 2013 Jes Sorensen - 3.2.6-12 +- Launch mdmon via systemctl to avoid it ending up in the wrong cgroup + and getting killed in the boot process when switching from the + initrd to the real root. +- Resolves bz879327 + +* Tue Jan 8 2013 Jes Sorensen - 3.2.6-11 +- Move code to leave udev cgroup into mdmon and excute it after we + work, to make sure it actually does the right thing. + +* Mon Jan 7 2013 Jes Sorensen - 3.2.6-10 +- Fix mdmonitor-takeover.service dangling symlink problem for real + +* Mon Jan 7 2013 Jes Sorensen - 3.2.6-9 +- Reintroduce fix for removing dangling symlink of + mdmonitor-takeover.service which got lost in the fix introduced in + 3.2.6-8 + +* Fri Jan 4 2013 Jes Sorensen - 3.2.6-8 +- mdmonitor-takeover.service is obsolete with the --offroot support, + and it is harmful as of 3.2.6 +- Resolves bz834245 + +* Mon Dec 10 2012 Jes Sorensen - 3.2.6-7 +- Fix issue with udev scripts where if an raid volume with one of + the disks failing, the failed disk is still present in the volume + and container. The raid volume stays is in normal state (should be + degraded) and the rebuild cannot start. +- Resolves bz886123 + +* Mon Dec 10 2012 Jes Sorensen - 3.2.6-5 +- mdadm-sysvinit is obsolete given that we no longer support booting + using sysvinit scripts +- Resolves bz884993 + +* Mon Dec 10 2012 Jes Sorensen - 3.2.6-4 +- Fix typo in error message in fix for 880972. No functional changes + +* Fri Nov 30 2012 Jes Sorensen - 3.2.6-3 +- Disallow creating a second IMSM RAID array size 0 (bz880972) +- Disallow creating IMSM RAIDs that spans multiple controllers (bz880974) +- Resolves bz880972, bz880974 + +* Thu Nov 15 2012 Doug Ledford - 3.2.6-2 +- Modify mdadm to set the cgroup of mdmon to systemd if it's available +- Related bz873576 (and others) + +* Thu Oct 25 2012 Jes Sorensen - 3.2.6-1 +- Upgrade to mdadm-3.2.6 +- Resolves bz869930 + +* Fri Oct 19 2012 Jes Sorensen - 3.2.5-14 +- Dummy update to work around bodhi breakage. No actual code changes. + +* Fri Oct 19 2012 Jes Sorensen - 3.2.5-13 +- Relax installation requirements for abrt script to only depend on + libreport-filesystem rather than the full abrt package + +* Thu Oct 18 2012 Jes Sorensen - 3.2.5-12 +- Add abrt script to retrieve /proc/mdstat output in case of crash +- Resolves bz867842 + +* Wed Oct 17 2012 Jes Sorensen - 3.2.5-11 +- Remove package requirements for udev and initscripts for F18+ +- Resolves bz864562 + +* Wed Oct 3 2012 Jes Sorensen - 3.2.5-9 +- Resolve issue with ambiguous licenses +- Resolves bz862761 + +* Mon Sep 10 2012 Jes Sorensen - 3.2.5-8 +- Switch to using new systemd macros for F18+ +- Resolves bz850202 + +* Thu Aug 2 2012 Jes Sorensen - 3.2.5-7 +- Remove bogus rogue patch applied in 3.2.5-5 with justification and + without following the structure of the mdadm package. + +* Fri Jul 27 2012 Fedora Release Engineering - 3.2.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jul 18 2012 Karsten Hopp 3.2.5-5 +- include in some to avoid type clashes. + same problem as rhbz #840902 + +* Mon Jul 16 2012 Jes Sorensen - 3.2.5-4 +- Move /etc/tmpfiles.d/mdadm.conf to /lib/tmpfiles.d/ to comply with + Fedora tmpfile rules +- Resolves bz840187 + +* Mon Jun 25 2012 Jes Sorensen - 3.2.5-3 +- Fix problem where reshape of RAID volume is broken after trying to + stop all MD devices. +- Enhance raid-check to allow the adming to specify the max number of + concurrent arrays to be checked at any given time. +- Resolves bz830177, bz820124 + +* Wed Jun 13 2012 Jes Sorensen - 3.2.5-2 +- Fix uninstall script to remove dangling symlink to + mdmonitor-takeover.service, if the mdadm package is uninstalled from + the system. +- Resolves bz828354 + +* Mon May 21 2012 Jes Sorensen - 3.2.5-1 +- Upgrade to mdadm-3.2.5 +- Resolves bz822850 + +* Tue May 15 2012 Jes Sorensen - 3.2.4-3 +- Fix mdadm-3.2.4 introduced bug where --add fails in common cases +- Resolves bz821717 (f17) bz821718 (f16) bz821719 (f15) + +* Thu May 10 2012 Jes Sorensen - 3.2.4-2 +- Fix mdadm.conf to use 'd' for /var/run/mdadm creation, to avoid the + map file getting deleted during boot. + +* Thu May 10 2012 Jes Sorensen - 3.2.4-1 +- Upgrade to mdadm-3.2.4 +- Resolves bz820534 (rawhide) bz820527 (f17) bz820531 (f16) bz820532 (f15) + +* Mon Apr 30 2012 Jes Sorensen - 3.2.3-9 +- Fix Monitor mode sometimes crashes when a resync completes +- Fix missing symlink for mdadm container device when incremental creates + the array +- Make sure when creating a second array in a container that the second + array uses all available space since leaving space for a third array + is invalid +- Validate the number of imsm volumes per controller +- Fix issues with imsm arrays and disks larger than 2TB +- Add support for expanding imsm arrays/containers +- The support for expanding imsm arrays/containers was accepted upstream, + update to the official patches from there +- Fix for the issue of --add not being very smart +- Fix an issue causing rebuilds to fail to restart on reboot (data + corrupter level problem) +- Reset the bad flag on map file updates +- Correctly fix failure when trying to add internal bitmap to 1.0 arrays +- Resolves: bz817023 (f17) bz817024 (f17) bz817026 (f17) bz817028 (f17) +- Resolves: bz817029 (f17) bz817032 (f17) bz817038 (f17) bz808774 (f17) +- Resolves: bz817039 (f17) bz817042 (f17) + +* Mon Apr 30 2012 Jes Sorensen - 3.2.3-8 +- Fix bug where IMSM arrays stay inactive in case a reboot is +- performed during the reshape process. +- Resolves: bz817522 (f17) bz817535 (f16) bz817537 (f15) + +* Wed Mar 28 2012 Jes Sorensen - 3.2.3-7 +- Fix issue when re-adding drive to a raid1 array with bitmap +- Resolves: bz807743 (f17) bz769323 (f16) bz791159 (f15) + +* Thu Feb 23 2012 Jes Sorensen - 3.2.3-6 +- Fix double free on buggy old kernel sysfs read +- Fix segfault if trying to write superblock to non existing device +- Resolves: bz795707 (f17) bz795747 (f16) bz795748 (f15) +- Resolves: bz795461 (f17) bz795749 (f16) bz795750 (f15) + +* Thu Feb 16 2012 Jes Sorensen - 3.2.3-5 +- Fix issue with devices failing to be added to a raid using bitmaps, + due to trying to write the bitmap with mis-aligned buffers using + O_DIRECT +- Resolves: bz789898 (f16) bz791189 (f15) + +* Mon Jan 30 2012 Jes Sorensen - 3.2.3-4 +- Add support for --offroot to mdadm/mdmon +- Resolves: bz785739 (rawhide) bz785737 (f16) bz771405 (f15) + +* Thu Jan 12 2012 Jes Sorensen - 3.2.3-3 +- Fix case where we have to retry in case a remove fails due to an array + being busy +- Resolves: bz773337 (rawhide) bz773340 (f16) bz773341 (f15) + +* Thu Jan 5 2012 Jes Sorensen - 3.2.3-2 +- Workaround for gcc-4.7 strict aliasing breaking the build + +* Wed Jan 4 2012 Jes Sorensen - 3.2.3-1 +- Update to upstream 3.2.3 +- Resolves: bz770110 (rawhide) bz771413 (f16) bz759014 (rawhide) +- Resolves: bz759015 (f16) bz759035 (rawhide) bz759036 (f16) +- Resolves: bz771608 (f15) bz759016 (f15) bz759039 (f15) + +* Mon Nov 21 2011 Jes Sorensen - 3.2.2-15 +- Backport upstream fix for memory leak that can prevent migration to + RAID5 from completing. +- Backport upstream fix preventing mounting a device while it is in + process of reshaping +- Resolves: bz755005 bz755009 + +* Wed Nov 9 2011 Jes Sorensen - 3.2.2-14 +- Backport upstream fixes to prevent growing v0.90 metadata raid out + of supported size. +- Add missing 'disable' argument to systemctl in preun script +- Resolves: bz735306 (Fedora 15) bz748731 (Fedora 16) bz748732 (rawhide), + Resolves: bz751716 + +* Wed Oct 26 2011 Fedora Release Engineering - 3.2.2-13 +- Rebuilt for glibc bug#747377 + +* Sat Oct 22 2011 Jes Sorensen - 3.2.2-12 +- Backport upstream version of fix for IMSM RAID assembly problem, + which resolves issues when booting off sysvinit based system. +- Resolves: bz736387 (Fedora 15) bz744217 (Fedora 16) + +* Wed Oct 19 2011 Jes Sorensen - 3.2.2-11 +- Fix systemd dependency problem +- Resolves: bz741115 (F16) bz744226 (rawhide) + +* Wed Oct 19 2011 Jes Sorensen - 3.2.2-10 +- Fix problem where a dirty IMSM RAID isn't assembled correctly during + boot, preventing booting from this RAID device. +- Resolves: bz736387 (Fedora 15) bz744217 (Fedora 16) +- Fix race between udev and mdadm when assembling md device using + mdadm -I, where udev would spawn an additional mdadm command to + perform the assembly in parallel. + +* Wed Aug 31 2011 Doug Ledford - 3.2.2-9 +- Fix boot with older imsm arrays that have an unused attribute set +- Resolves: bz729205 + +* Thu Aug 25 2011 Doug Ledford - 3.2.2-8 +- Rework the 65-md-incremental.rules file to add the following support: + Nested md raid arrays should now work + MD on top of LUKS or other lvm based devices should now work + We should no longer grab multipath paths before multipath can + +* Wed Jul 27 2011 Doug Ledford - 3.2.2-7 +- Fix a bug with readding a device +- Fix a bug with writemostly flag handling + +* Mon Jul 18 2011 Doug Ledford - 3.2.2-6 +- Bump and rebuild again + +* Fri Jul 15 2011 Doug Ledford - 3.2.2-5 +- Bump and rebuild to keep version ahead of f15 version + +* Thu Jul 14 2011 Doug Ledford - 3.2.2-4 +- Fix minor issue in man page +- Resolves: bz717795 + +* Thu Jul 07 2011 Milan Broz - 3.2.2-3 +- Use unit files with systemd. (johannbg) +- Add sub-package sysvinit for SysV init script. +- Resolves: bz713573 + +* Wed Jul 06 2011 Milan Broz - 3.2.2-2 +- Fix build on PPC. +- Resolves: bz719380 + +* Tue Jun 28 2011 Milan Broz - 3.2.2-1 +- Update to latest upstream version +- Resolves: bz714083 + +* Tue Jun 14 2011 Doug Ledford - 3.2.1-5 +- Fix for bz710646 + +* Thu Mar 31 2011 Doug Ledford - 3.2.1-4 +- Somehow the 64-md-raid.rules file went missing. Put it back. +- Resolves: bz692248 + +* Thu Mar 31 2011 Doug Ledford - 3.2.1-3 +- Fix mdmonitor init script setup of SELinux on PIDPATH +- Resolves: bz692559 + +* Mon Mar 28 2011 Doug Ledford - 3.2.1-2 +- Restore build command to sane command instead of test command + +* Mon Mar 28 2011 Doug Ledford - 3.2.1-1 +- Update to latest upstream version +- Resolves: 691353 + +* Fri Mar 25 2011 Doug Ledford - 3.1.5-1 +- Update to latest upstream stable release +- Update mdadm.rules file to honor noiswmd and nodmraid command line options +- Ghost the directory in /var/run, create /var/run/mdadm in mdmonitor init + script +- Don't report mismatch counts on either raid1 or raid10 +- Check both active and idle arrays during raid check runs +- Move the raid-check script from cron.weekly to /usr/sbin, add a crontab + file to /etc/cron.d and mark it config(noreplace). This way users can + select their own raid-check frequency and have it honored through + upgrades. +- Allow the raid-check script to set the process and io priority of the + thread performing the check in order to preserve responsiveness of the + machine during the check. +- Resolves: 633229, 656620. 679843, 671076, 659933 + +* Tue Feb 08 2011 Fedora Release Engineering - 3.1.3-0.git20100804.2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Aug 04 2010 Doug Ledford - 3.1.3-0.git20100804.2 +- Add udev patch to not have incremental assembly in two rules files + +* Wed Aug 04 2010 Doug Ledford - 3.1.3-0.git20100804.1 +- Update to latest upstream release (resolves an issue with stale lock + files on the md device map file) + +* Thu Jul 22 2010 Doug Ledford - 3.1.3-0.git20100722.2 +- Remove the glibc-static buildreq and don't build the static mdadm since + we don't install it anyway +- Remove the udev file since adding it was supposed to be a rawhide only change + +* Thu Jul 22 2010 Doug Ledford - 3.1.3-0.git20100722.1 +- Change git date format to the correct format (YYYYMMDD) +- Update to latest upstream push (fixes bz604023) + +* Tue Jul 20 2010 Doug Ledford - 3.1.3-0.git07202010.2 +- Fix racy locking of mapfile (bz616596) + +* Tue Jul 20 2010 Doug Ledford - 3.1.3-0.git07202010.1 +- Update to latest git repo (3.1.2 plus pending changes, fixes bz602457) +- Add in 64-md-raid.rules to compensate for it no longer being in udev + (bz581905) +- Remove mdadm.static as its no longer used in initrd creation + +* Tue Apr 13 2010 Doug Ledford - 3.1.2-10 +- Minor update to mdadm.rules to make anaconda happy + +* Thu Apr 08 2010 Doug Ledford - 3.1.2-9 +- Slight fix on container patch + +* Thu Apr 08 2010 Doug Ledford - 3.1.2-8 +- Updated container patch that also enables mdadm -IRs for imsm devices + +* Tue Apr 06 2010 Doug Ledford - 3.1.2-7 +- Fix up directory in mdmonitor init script so that we restart mdmon like we + are supposed to +- Add a rule to run incremental assembly on containers in case there are + multiple volumes in a container and we only started some of them in the + initramfs +- Make -If work with imsm arrays. We had too restrictive of a test in + sysfs_unique_holder. +- Make incremental assembly of containers act like incremental assembly of + regular devices (aka, --run is needed to start a degraded array) + +* Tue Apr 06 2010 Doug Ledford - 3.1.2-6 +- Typo in new rules file + +* Tue Apr 06 2010 Doug Ledford - 3.1.2-5 +- Enable incremental support for imsm devices + +* Tue Apr 06 2010 Doug Ledford - 3.1.2-4 +- One line fix for ppc64 compiles + +* Tue Apr 06 2010 Doug Ledford - 3.1.2-3 +- Clean up directory mess once and for all +- Add incremental remove support + +* Wed Mar 17 2010 Doug Ledford - 3.1.2-2 +- Add a little more paranoia checking to the RebuildMap code to avoid ever + having the same infinite loop as in bz569019 again even if we change file + locations to somewhere where we can't create a mapfile + +* Tue Mar 16 2010 Doug Ledford - 3.1.2-1 +- Grab latest upstream release instead of git repo snapshot (bz552344, bz572561) +- The lack of /dev/md is causing problems, so add code to mapfile.c to cause + us to create /dev/md if it doesn't exist (bz569019) + +* Tue Feb 23 2010 Doug Ledford - 3.1.1-0.gcd9a8b5.6 +- Newer version of imsm patch that leaves warning, but only when there + actually are too many devices on the command line (bz554974) + +* Sun Feb 21 2010 Doug Ledford - 3.1.1-0.gcd9a8b5.5 +- The uuid patch cause a different problem during assembly, so use a gross + hack to work around the uuid issue that won't break assembly until fixed + properly upstream (bz567132) + +* Sun Feb 21 2010 Doug Ledford - 3.1.1-0.gcd9a8b5.4 +- Fix problem with booting multiple imsm containers when they aren't listed + "just so" in the mdadm.conf file (bz554974) + +* Fri Feb 19 2010 Doug Ledford - 3.1.1-0.gcd9a8b5.3 +- Don't run the raid-check script if the kernel doesn't support + md devices (bz557053) +- Don't report any mismatch_cnt issues on raid1 devices as there are + legitimate reasons why the count may not be 0 and we are getting enough + false positives that it renders the check useless (bz554217, bz547128) + +* Thu Feb 18 2010 Doug Ledford - 3.1.1-0.gcd9a8b5.2 +- Fix s390/ppc64 UUID byte swap issue + +* Wed Feb 17 2010 Doug Ledford - 3.1.1-0.gcd9a8b5.1 +- Update to head of upstream git repo, which contains a significant number + of bug fixes we need (bz543746) + +* Fri Jan 15 2010 Doug Ledford - 3.0.3-3 +- Fix crash when AUTO keyword is in mdadm.conf (bz552342) + +* Tue Dec 01 2009 Doug Ledford - 3.0.3-2 +- Minor tweak to init script for LSB compliance (bz527957) + +* Wed Nov 04 2009 Doug Ledford - 3.0.3-1 +- New upstream release 3.0.3 (bz523320, bz527281) +- Update a couple internal patches +- Drop a patch in that was in Neil's tree for 3.0.3 that we had pulled for + immediate use to resolve a bug +- Drop the endian patch because it no longer applied cleanly and all attempts + to reproduce the original problem as reported in bz510605 failed, even up + to and including downloading the specific package that was reported as + failing in that bug and trying to reproduce with it on both ppc and ppc64 + hardware and with both ppc and ppc64 versions on the 64bit hardware. + Without a reproducer, it is impossible to determine if a rehashed patch + to apply to this code would actually solve the problem, so remove the patch + entirely since the original problem, as reported, was an easy to detect DOA + issue where installing to a raid array was bound to fail on reboot and so + we should be able to quickly and definitively tell if the problem resurfaces. +- Update the mdmonitor init script for LSB compliance (bz527957) +- Link from mdadm.static man page to mdadm man page (bz529314) +- Fix a problem in the raid-check script (bz523000) +- Fix the intel superblock handler so we can test on non-scsi block devices + +* Fri Oct 2 2009 Hans de Goede - 3.0.2-1 +- New upstream release 3.0.2 +- Add a patch fixing mdadm --detail -export segfaults (bz526761, bz523862) +- Add a patch making mdmon store its state under /dev/.mdadm for initrd + mdmon, rootfs mdmon handover +- Restart mdmon from initscript (when running) for rootfs mdmon handover + +* Thu Sep 17 2009 Doug Ledford - 3.0-4 +- Stop some mdmon segfaults (bz523860) + +* Tue Sep 15 2009 Doug Ledford - 3.0-3 +- Update to current head of upstream git repo for various imsm related fixes + (fixes bz523262) +- Fix display of metadata version in output of Detail mode +- Add UUID output to --detail --export (bz523314) + +* Fri Jul 24 2009 Doug Ledford - 3.0-2 +- Improved raid-check script as well as the ability to configure what devices + get checked +- Endian patch for uuid generation + +* Mon Jun 29 2009 Doug Ledford - 3.0-1 +- Remove stale patches already accepted by upstream +- Fix the raid-check script to only try and check a device if it is + checkable +- Update to official mdadm-3.0 version +- Resolves: bz505587, bz505552 + +* Tue May 19 2009 Doug Ledford - 3.0-0.devel3.7 +- Move the mdadm.map file from /dev/md/ to /dev/ so the installer doesn't + need to precreate the /dev/md/ directory in order for incremental + assembly to work + +* Tue May 19 2009 Doug Ledford - 3.0-0.devel3.6 +- Only check raid devices automatically, do not attempt to repair them + during the weekly data scrubbing + +* Fri Mar 20 2009 Doug Ledford - 3.0-0.devel3.5 +- Fix a few issues with the new code to determine when a device gets to + keep its name and when it doesn't + +* Fri Mar 20 2009 Doug Ledford - 3.0-0.devel3.4 +- Change the perms on the udev rules file, it doesn't need to be +x + +* Fri Mar 20 2009 Doug Ledford - 3.0-0.devel3.3 +- Slightly tweak the udev rules to make sure we don't start arrays + while running in rc.sysinit...leave array starting to it instead +- Modify mdadm to put its mapfile in /dev/md instead of /var/run/mdadm + since at startup /var/run/mdadm is read-only by default and this + breaks incremental assembly +- Change how mdadm decides to assemble incremental devices using their + preferred name or a random name to avoid possible conflicts when plugging + a foreign array into a host + +* Wed Mar 18 2009 Doug Ledford - 3.0-0.devel3.2 +- Change around the mdadm udev rules we ship to avoid a udev file conflict + +* Tue Mar 17 2009 Doug Ledford - 3.0-0.devel3.1 +- Update to latest devel release +- Remove the no longer necessary udev patch +- Remove the no longer necessary warn patch +- Remove the no longer necessary alias patch +- Update the mdadm.rules file to only pay attention to device adds, not + changes and to enable incremental assembly +- Add a cron job to run a weekly repair of the array to correct bad sectors +- Resolves: bz474436, bz490972 + +* Wed Feb 25 2009 Fedora Release Engineering - 3.0-0.devel2.2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Feb 19 2009 Doug Ledford - 3.0-0.devel2.2 +- Readd our old mdadm rules file that does incremental assembly +- Remove the new mdadm rules file from upstream as we already have this in + our udev package (and the one in the udev package already has a bug fixed) + +* Thu Feb 12 2009 Doug Ledford - 3.0-0.devel2.1 +- Update to latest upstream devel release +- Use the udev rules file included with mdadm instead of our own +- Drop all the no longer relevant patches +- Fix a build error in mdopen.c +- Fix the udev rules path in Makefile +- Fix a compile issue with the __le32_to_cpu() macro usage (bad juju to + to operations on the target of the macro as it could get executed + multiple times, and gcc now throws an error on that) +- Add some casts to some print statements to keep gcc from complaining + +* Fri Oct 24 2008 Doug Ledford - 2.6.7.1-1 +- Updated to latest upstream stable release (#466803) +- Change udev rule to not assemble degraded arrays (#453314) +- Fix metadata matching in config file (#466078) +- Fix assembly of raid10 devices (#444237) +- Fix incremental assembly of partitioned raid devices (#447818) + +* Thu Jun 26 2008 Doug Ledford - 2.6.7-1 +- Update to latest upstream version (should resolve #444237) +- Drop incremental patch as it's now part of upstream +- Clean up all the open() calls in the code (#437145) +- Fix the build process to actually generate mdassemble (#446988) +- Update the udev rules to get additional info about arrays being assembled + from the /etc/mdadm.conf file (--scan option) (#447818) +- Update the udev rules to run degraded arrays (--run option) (#452459) + +* Thu Apr 17 2008 Bill Nottingham - 2.6.4-4 +- make /dev/md if necessary in incremental mode (#429604) +- open RAID devices with O_EXCL to avoid racing against other --incremental processes (#433932) + +* Fri Feb 1 2008 Bill Nottingham - 2.6.4-3 +- add a udev rules file for device assembly (#429604) + +* Fri Jan 18 2008 Doug Ledford - 2.6.4-2 +- Bump version and rebuild + +* Fri Oct 19 2007 Doug Ledford - 2.6.4-1 +- Update to latest upstream and remove patches upstream has taken + +* Tue Aug 28 2007 Fedora Release Engineering - 2.6.2-5 +- Rebuild for selinux ppc32 issue. + +* Mon Jul 09 2007 Doug Ledford - 2.6.2-4 +- Oops, if we call -C -e1, minor_version is no longer properly set, fix that + up +- Related: bz230207 + +* Fri Jul 06 2007 Doug Ledford - 2.6.2-3 +- Oops, had to update the file leak patch, missed one thing +- Minor tweak to return codes in init script and add LSB header +- Resolves: bz244582, bz246980 + +* Mon Jul 02 2007 Doug Ledford - 2.6.2-2 +- Fix a file leak issue when mdadm is in monitor mode +- Update mdadm init script so that status will always run and so + return codes are standards compliant +- Fix assembly of version 1 superblock devices +- Make the attempt to create an already running device have a clearer + error message +- Allow the creation of a degraded raid4 array like we allow for raid5 +- Make mdadm actually pay attention to raid4 devices when in monitor mode +- Make the mdmonitor script use daemon() correctly +- Fix a bug where manage mode would not add disks correctly under certain + conditions +- Resolves: bz244582, bz242688, bz230207, bz169516, bz171862, bz171938 +- Resolves: bz174642, bz224272, bz186524 + +* Mon Jul 02 2007 Doug Ledford - 2.6.2-1 +- Update to latest upstream +- Remove requirement for /usr/sbin/sendmail - it's optional and not on by + default, and sendmail isn't *required* for mdadm itself to work, and isn't + even required for the monitoring capability to work, just if you want to + have the monitoring capability do the automatic email thing instead of + run your own program (and if you use the program option of the monitor + capability, your program could email you in a different manner entirely) + +* Mon Apr 16 2007 Doug Ledford - 2.6.1-4 +- More cleanups for merge review process +- Related: bz226134 + +* Wed Apr 11 2007 Doug Ledford - 2.6.1-3 +- Various cleanups as part of merge review process +- Related: bz226134 + +* Sat Mar 31 2007 Doug Ledford - 2.6.1-2 +- Oops, missing a dependency in the Makefile + +* Sat Mar 31 2007 Doug Ledford - 2.6.1-1 +- Update to latest upstream version +- Resolves: bz233422 + +* Fri Jan 26 2007 Doug Ledford - 2.6-1 +- Update to latest upstream version +- Remove the mdmpd daemon entirely. Now that multipath tools from the lvm/dm + packages handles multipath devices well, this is no longer needed. +- Various cleanups in the spec file + +* Thu Nov 09 2006 Doug Ledford - 2.5.4-3 +- Add a fix for the broken printout of array GUID when using the -E --brief + flags + +* Fri Oct 13 2006 Doug Ledford - 2.5.4-2 +- tag present on another branch and can't be forcibly moved + required number bump + +* Fri Oct 13 2006 Doug Ledford - 2.5.4-1 +- Update to 2.5.4 (listed as a bugfix update by upstream) +- Remove previous bitmap patch that's now part of 2.5.4 + +* Sun Oct 8 2006 Doug Ledford - 2.5.3-2 +- Fix a big-endian machine error in the bitmap code (Paul Clements) + +* Mon Aug 7 2006 Doug Ledford - 2.5.3-1 +- Update to 2.5.3 which upstream calls a "bug fix" release + +* Wed Jul 12 2006 Jesse Keating - 2.5.2-1.1 +- rebuild + +* Fri Jul 7 2006 Doug Ledford - 2.5.2-1 +- Update to 2.5.2 +- Remove auto default patch as upstream now has a preferred default auto method + +* Wed Mar 8 2006 Peter Jones - 2.3.1-3 +- fix build on ppc64 + +* Wed Mar 8 2006 Jeremy Katz - 2.3.1-2 +- fix build on ppc + +* Wed Mar 8 2006 Jeremy Katz - 2.3.1-1 +- update to 2.3.1 to fix raid5 (#184284) + +* Fri Feb 10 2006 Jesse Keating - 2.2-1.fc5.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 2.2-1.fc5.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Mon Dec 05 2005 Warren Togami 2.2-1 +- 2.2 upgrade (#167897) +- disable diet because we don't ship it anymore + and we don't actually use mdassemble now + +* Mon May 16 2005 Doug Ledford 1.11.0-4.fc4 +- Make the mdmonitor init script use the pid-file option, major cleanup + of the script now possible (#134459) + +* Mon May 16 2005 Doug Ledford 1.11.0-3.fc4 +- Put back the obsoletes: raidtools that was present in 1.11.0-1.fc4 + +* Mon May 16 2005 Doug Ledford 1.11.0-2.fc4 +- Change the default auto= mode so it need not be on the command line to + work with udev, however it is still supported on the command line (#132706) +- Add a man page (from Luca Berra) for mdassemble + +* Wed May 11 2005 Doug Ledford - 1.11.0-1.fc4 +- Upgrade to 1.11.0 + +* Wed Apr 27 2005 Jeremy Katz - 1.9.0-3.fc4 +- fix mdmonitor initscript (#144717) + +* Mon Mar 21 2005 Doug Ledford 1.9.0-2 +- Build mdadm.static and mdassemble (static as well) to be used in initrd + images + +* Wed Mar 09 2005 Doug Ledford 1.9.0-1 +- Initial upgrade to 1.9.0 and update of doc files +- Fix an s390 build error + +* Mon Oct 04 2004 Doug Ledford 1.6.0-2 +- Remove /etc/mdadm.conf from the file list. Anaconda will write one out + if it's needed. + +* Fri Oct 01 2004 Doug Ledford 1.6.0-1 +- Update to newer upstream version +- Make mdmpd work on kernels that don't have the event interface patch + +* Fri Jul 30 2004 Dan Walsh 1.5.0-11 +- Create a directory /var/run/mdadm to contain mdadm.pid +- This cleans up SELinux problem + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Sat May 22 2004 Doug Ledford - 1.5.0-9 +- Fix Makefile and build method to satisfy bz #123769 +- Add mdmpd man page, update mdmpd version to 0.3 - bz #117160 +- Make sure mdadm --monitor closes all md device files so that md devices + can be stopped while mdadm is still running - bz #119532 + +* Thu May 20 2004 Jeremy Katz - 1.5.0-8 +- remove unneeded patch, can use --run instead + +* Wed May 19 2004 Jeremy Katz - 1.5.0-7 +- add patch with reallyforce mode on creation to be used by anaconda + +* Wed May 12 2004 Doug Ledford 2.5.0-6 +- Fix a bug in the postun scriptlet related to downgrading to a version + of mdadm that doesn't include the mdmpd daemon. + +* Fri May 07 2004 Doug Ledford 1.5.0-5 +- Disable service mdmpd by default to avoid [Failed] messages on + current 2.6 kernels. Possibly re-enable it by default once the + 2.6 kernels have the md event interface. + +* Thu Apr 22 2004 Doug Ledford 1.5.0-4 +- Update mdmonitor script to start daemon more cleanly +- Repackage mdmpd tarball to include gcc-3.4 changes and to make + mdmpd properly daemonize at startup instead of forking and leaving + the child attached to the terminal. + +* Thu Mar 4 2004 Bill Nottingham 1.5.0-3 +- ship /var/run/mpmpd (#117497) + +* Thu Feb 26 2004 Doug Ledford 1.5.0-2 +- Add a default MAILADDR line to the mdadm.conf file installed by default + (Bugzilla #92447) +- Make it build with gcc-3.4 + +* Mon Feb 23 2004 Doug Ledford 1.5.0-1 +- Update to 1.5.0 (from Matthew J. Galgoci ) + +* Sun Nov 16 2003 Doug Ledford 1.4.0-1 +- fix problem with recovery thread sleeping in mdmpd + +* Fri Nov 14 2003 Doug Ledford +- sync upstream +- add mdmpd package into mdadm package + +* Wed Sep 10 2003 Michael K. Johnson 1.3.0-1 +- sync upstream + +* Tue Mar 11 2003 Michael K. Johnson 1.1.0-1 +- sync upstream + +* Tue Jan 28 2003 Michael K. Johnson 1.0.1-1 +- update for rebuild + +* Wed Dec 25 2002 Tim Powers 1.0.0-8 +- fix references to %%install in the changelog so that it will build + +* Fri Dec 13 2002 Elliot Lee 1.0.0-7 +- Rebuild + +* Fri Jul 12 2002 Michael K. Johnson +- Changed RPM Group to System Environment/Base + +* Wed May 15 2002 Michael K. Johnson +- minor cleanups to the text, conditionalize rm -rf +- added mdmonitor init script + +* Fri May 10 2002 +- update to 1.0.0 +- Set CXFLAGS instead of CFLAGS + +* Sat Apr 6 2002 +- change %%install to use "make install" + +* Fri Mar 15 2002 +- beautification +- made mdadm.conf non-replaceable config +- renamed Copyright to License in the header +- added missing license file +- used macros for file paths + +* Fri Mar 15 2002 Luca Berra +- Added Obsoletes: mdctl +- missingok for configfile + +* Tue Mar 12 2002 NeilBrown +- Add md.4 and mdadm.conf.5 man pages + +* Fri Mar 08 2002 Chris Siebenmann +- builds properly as non-root. + +* Fri Mar 08 2002 Derek Vadala +- updated for 0.7, fixed /usr/share/doc and added manpage + +* Tue Aug 07 2001 Danilo Godec +- initial RPM build