- 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.
This commit is contained in:
Doug Ledford 2010-04-07 14:51:17 +00:00
parent 85e79a28a3
commit f2098b61d7
4 changed files with 67 additions and 8 deletions

View File

@ -0,0 +1,35 @@
commit 1934c67fe5bc25a79393ad78e29bf9ef778bc701
Author: Doug Ledford <dledford@redhat.com>
Date: Tue Apr 6 23:02:47 2010 -0400
Only close lfd if we have an external metadata type since that's the only
time we'll have it open.
If we weren't able to open the device file, assume the device is gone
already and skip the sysfs_unique_holder test as it is guaranteed to
fail.
Signed-off-by: Doug Ledford <dledford@redhat.com>
diff --git a/Manage.c b/Manage.c
index b15586b..a690cfc 100644
--- a/Manage.c
+++ b/Manage.c
@@ -811,6 +811,7 @@ int Manage_subdevs(char *devname, int fd,
* rely on the 'detached' checks
*/
if (strcmp(dv->devname, "detached") == 0 ||
+ tfd < 0 ||
sysfs_unique_holder(dnum, stb.st_rdev))
/* pass */;
else {
@@ -878,8 +879,8 @@ int Manage_subdevs(char *devname, int fd,
ping_manager(name);
free(name);
+ close(lfd);
}
- close(lfd);
if (verbose >= 0)
fprintf(stderr, Name ": hot removed %s\n",
dnprintable);

View File

@ -3,13 +3,23 @@
# See udev(8) for syntax # See udev(8) for syntax
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \ SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
RUN+="/sbin/mdadm -I $env{DEVNAME}" RUN+="/sbin/mdadm -I $tempnode"
SUBSYSTEM=="block", ACTION=="remove", ENV{ID_FS_TYPE}=="linux_raid_member", \ SUBSYSTEM=="block", ACTION=="remove", ENV{ID_FS_TYPE}=="linux_raid_member", \
RUN+="/sbin/mdadm -If $env{DEVNAME}" RUN+="/sbin/mdadm -If $env{DEVNAME}"
ENV{rd_NO_MDIMSM}=="?*", GOTO="md_imsm_inc_end" ENV{rd_NO_MDIMSM}=="?*", GOTO="md_imsm_inc_end"
# 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 $tempnode"
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="isw_raid_member", \ SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="isw_raid_member", \
RUN+="/sbin/mdadm -I $env{DEVNAME}" RUN+="/sbin/mdadm -I $tempnode"
SUBSYSTEM=="block", ACTION=="remove", ENV{ID_FS_TYPE}=="isw_raid_member", \ SUBSYSTEM=="block", ACTION=="remove", ENV{ID_FS_TYPE}=="isw_raid_member", \
RUN+="/sbin/mdadm -If $env{DEVNAME}" RUN+="/sbin/mdadm -If $env{DEVNAME}"
LABEL="md_imsm_inc_end" LABEL="md_imsm_inc_end"

View File

@ -1,7 +1,7 @@
Summary: The mdadm program controls Linux md devices (software RAID arrays) Summary: The mdadm program controls Linux md devices (software RAID arrays)
Name: mdadm Name: mdadm
Version: 3.1.2 Version: 3.1.2
Release: 6%{?dist} Release: 7%{?dist}
Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2 Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2
Source1: mdmonitor.init Source1: mdmonitor.init
Source2: raid-check Source2: raid-check
@ -14,6 +14,7 @@ Patch4: mdadm-3.1.2-rebuild.patch
Patch5: mdadm-3.1.2-directory.patch Patch5: mdadm-3.1.2-directory.patch
Patch6: mdadm-3.1.2-decremental.patch Patch6: mdadm-3.1.2-decremental.patch
Patch7: mdadm-3.1.2-decremental-2.patch Patch7: mdadm-3.1.2-decremental-2.patch
Patch10: mdadm-3.1.2-decremental-3.patch
Patch8: mdadm-3.1.2-powerpc-compile.patch Patch8: mdadm-3.1.2-powerpc-compile.patch
Patch9: mdadm-2.5.2-static.patch Patch9: mdadm-2.5.2-static.patch
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/ URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
@ -43,6 +44,7 @@ file can be used to help with some common tasks.
%patch5 -p1 -b .directory %patch5 -p1 -b .directory
%patch6 -p1 -b .decremental %patch6 -p1 -b .decremental
%patch7 -p1 -b .decremental-2 %patch7 -p1 -b .decremental-2
%patch10 -p1 -b .decremental-3
%patch8 -p1 -b .powerpc %patch8 -p1 -b .powerpc
%patch9 -p1 -b .static %patch9 -p1 -b .static
@ -91,6 +93,15 @@ fi
%attr(0700,root,root) %dir /var/run/mdadm %attr(0700,root,root) %dir /var/run/mdadm
%changelog %changelog
* Tue Apr 06 2010 Doug Ledford <dledford@redhat.com> - 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.
* Tue Apr 06 2010 Doug Ledford <dledford@redhat.com> - 3.1.2-6 * Tue Apr 06 2010 Doug Ledford <dledford@redhat.com> - 3.1.2-6
- Typo in new rules file - Typo in new rules file

View File

@ -41,11 +41,14 @@ usage ()
start () start ()
{ {
# (Re)start mdmon to take over monitoring of mdmon started from the initrd # (Re)start mdmon to take over monitoring of mdmon started from the initrd
if [ -f /dev/md/*.pid ]; then for i in /dev/md/*.pid; do
origprog="$prog"; prog="mdmon" if [ -r $i ]; then
action $"Starting $prog: " /sbin/mdmon --takeover --all origprog="$prog"; prog="mdmon"
prog="$origprog" action $"Starting $prog: " /sbin/mdmon --takeover --all
fi prog="$origprog"
break
fi
done
# Make sure configuration file exists and has information we can use # 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 # MAILADDR or PROGRAM or both must be set in order to run mdadm --monitor
[ -f /etc/mdadm.conf ] || return 6 [ -f /etc/mdadm.conf ] || return 6