- 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
This commit is contained in:
parent
bf7f590ca9
commit
c8f603e0a8
@ -1 +1 @@
|
||||
mdadm-3.0.2.tar.bz2
|
||||
mdadm-3.0.3.tar.bz2
|
||||
|
@ -1,15 +0,0 @@
|
||||
diff -up mdadm-3.0-devel3/util.c.foo mdadm-3.0-devel3/util.c
|
||||
--- mdadm-3.0-devel3/util.c.foo 2009-07-09 18:57:47.000000000 -0400
|
||||
+++ mdadm-3.0-devel3/util.c 2009-07-09 18:58:09.000000000 -0400
|
||||
@@ -282,7 +282,11 @@ char *fname_from_uuid(struct supertype *
|
||||
char *c = buf;
|
||||
strcpy(c, "UUID-");
|
||||
c += strlen(c);
|
||||
+#if __BYTE_ORDER == BIG_ENDIAN
|
||||
+ copy_uuid(uuid, info->uuid, st->ss->swapuuid || !strcmp(st->ss->name,"0.90"));
|
||||
+#else
|
||||
copy_uuid(uuid, info->uuid, st->ss->swapuuid);
|
||||
+#endif
|
||||
for (i = 0; i < 4; i++) {
|
||||
id = uuid[i];
|
||||
if (i)
|
@ -1,7 +1,15 @@
|
||||
diff -up mdadm-3.0/mdmon.c~ mdadm-3.0/mdmon.c
|
||||
--- mdadm-3.0/mdmon.c~ 2009-09-19 14:22:23.000000000 +0200
|
||||
+++ mdadm-3.0/mdmon.c 2009-09-19 14:22:23.000000000 +0200
|
||||
@@ -124,7 +124,7 @@ int make_pidfile(char *devname, int o_ex
|
||||
--- mdadm-3.0.3/mdmon.c.mdmon 2009-10-21 20:13:13.000000000 -0400
|
||||
+++ mdadm-3.0.3/mdmon.c 2009-11-04 13:00:26.924089288 -0500
|
||||
@@ -118,7 +118,7 @@ static int test_pidfile(char *devname)
|
||||
char path[100];
|
||||
struct stat st;
|
||||
|
||||
- sprintf(path, "/var/run/mdadm/%s.pid", devname);
|
||||
+ sprintf(path, "/dev/.mdadm/%s.pid", devname);
|
||||
return stat(path, &st);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ int make_pidfile(char *devname, int o_ex
|
||||
if (sigterm)
|
||||
return -1;
|
||||
|
||||
@ -10,16 +18,16 @@ diff -up mdadm-3.0/mdmon.c~ mdadm-3.0/mdmon.c
|
||||
|
||||
fd = open(path, O_RDWR|O_CREAT|o_excl, 0600);
|
||||
if (fd < 0)
|
||||
@@ -157,7 +157,7 @@ static void try_kill_monitor(char *devna
|
||||
pid_t pid;
|
||||
struct mdstat_ent *mdstat;
|
||||
@@ -163,7 +163,7 @@ pid_t devname2mdmon(char *devname)
|
||||
pid_t pid = -1;
|
||||
int fd;
|
||||
|
||||
- sprintf(buf, "/var/run/mdadm/%s.pid", devname);
|
||||
+ sprintf(buf, "/dev/.mdadm/%s.pid", devname);
|
||||
fd = open(buf, O_RDONLY);
|
||||
fd = open(buf, O_RDONLY|O_NOATIME);
|
||||
if (fd < 0)
|
||||
return;
|
||||
@@ -207,9 +207,9 @@ void remove_pidfile(char *devname)
|
||||
return -1;
|
||||
@@ -217,9 +217,9 @@ void remove_pidfile(char *devname)
|
||||
if (sigterm)
|
||||
return;
|
||||
|
||||
@ -31,7 +39,7 @@ diff -up mdadm-3.0/mdmon.c~ mdadm-3.0/mdmon.c
|
||||
unlink(buf);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ int make_control_sock(char *devname)
|
||||
@@ -233,7 +233,7 @@ int make_control_sock(char *devname)
|
||||
if (sigterm)
|
||||
return -1;
|
||||
|
||||
@ -40,24 +48,8 @@ diff -up mdadm-3.0/mdmon.c~ mdadm-3.0/mdmon.c
|
||||
unlink(path);
|
||||
sfd = socket(PF_LOCAL, SOCK_STREAM, 0);
|
||||
if (sfd < 0)
|
||||
@@ -478,11 +478,10 @@ int mdmon(char *devname, int devnum, int
|
||||
}
|
||||
|
||||
/* If this fails, we hope it already exists
|
||||
- * pid file lives in /var/run/mdadm/mdXX.pid
|
||||
+ * pid file lives in /dev/.mdadm/mdXX.pid
|
||||
*/
|
||||
- mkdir("/var", 0600);
|
||||
- mkdir("/var/run", 0600);
|
||||
- mkdir("/var/run/mdadm", 0600);
|
||||
+ mkdir("/dev", 0700);
|
||||
+ mkdir("/dev/.mdadm", 0700);
|
||||
ignore = chdir("/");
|
||||
if (make_pidfile(container->devname, O_EXCL) < 0) {
|
||||
if (ping_monitor(container->devname) == 0) {
|
||||
diff -up mdadm-3.0/msg.c~ mdadm-3.0/msg.c
|
||||
--- mdadm-3.0/msg.c~ 2009-09-11 08:10:24.000000000 +0200
|
||||
+++ mdadm-3.0/msg.c 2009-09-19 15:31:27.000000000 +0200
|
||||
--- mdadm-3.0.3/msg.c.mdmon 2009-10-21 20:13:13.000000000 -0400
|
||||
+++ mdadm-3.0.3/msg.c 2009-11-04 12:12:46.281963910 -0500
|
||||
@@ -147,7 +147,7 @@ int connect_monitor(char *devname)
|
||||
int pos;
|
||||
char *c;
|
||||
@ -67,10 +59,9 @@ diff -up mdadm-3.0/msg.c~ mdadm-3.0/msg.c
|
||||
if (is_subarray(devname)) {
|
||||
devname++;
|
||||
c = strchr(devname, '/');
|
||||
diff -up mdadm-3.0/util.c~ mdadm-3.0/util.c
|
||||
--- mdadm-3.0/util.c~ 2009-09-19 14:22:23.000000000 +0200
|
||||
+++ mdadm-3.0/util.c 2009-09-19 15:32:22.000000000 +0200
|
||||
@@ -1206,7 +1206,7 @@ int mdmon_running(int devnum)
|
||||
--- mdadm-3.0.3/util.c.mdmon 2009-10-21 21:07:14.000000000 -0400
|
||||
+++ mdadm-3.0.3/util.c 2009-11-04 12:12:46.282963942 -0500
|
||||
@@ -1208,7 +1208,7 @@ int mdmon_running(int devnum)
|
||||
char pid[10];
|
||||
int fd;
|
||||
int n;
|
||||
@ -79,7 +70,7 @@ diff -up mdadm-3.0/util.c~ mdadm-3.0/util.c
|
||||
fd = open(path, O_RDONLY, 0);
|
||||
|
||||
if (fd < 0)
|
||||
@@ -1226,7 +1226,7 @@ int signal_mdmon(int devnum)
|
||||
@@ -1228,7 +1228,7 @@ int signal_mdmon(int devnum)
|
||||
char pid[10];
|
||||
int fd;
|
||||
int n;
|
||||
|
@ -1,46 +0,0 @@
|
||||
From: NeilBrown <neilb@suse.de>
|
||||
Date: Thu, 1 Oct 2009 02:51:04 +0000 (+1000)
|
||||
Subject: Fix null-dereference in set_member_info
|
||||
X-Git-Url: http://neil.brown.name/git?p=mdadm;a=commitdiff_plain;h=2b9aa337af7291d3f141322da96c9f667c99d53c
|
||||
|
||||
Fix null-dereference in set_member_info
|
||||
|
||||
set_member_info would try to dereference ->metadata_version, without
|
||||
checking that it isn't NULL.
|
||||
|
||||
Signed-off-by: NeilBrown <neilb@suse.de>
|
||||
---
|
||||
|
||||
diff --git a/mapfile.c b/mapfile.c
|
||||
index a3038be..ed59db5 100644
|
||||
--- a/mapfile.c
|
||||
+++ b/mapfile.c
|
||||
@@ -303,19 +303,22 @@ struct map_ent *map_by_name(struct map_ent **map, char *name)
|
||||
*/
|
||||
static void set_member_info(struct supertype *st, struct mdstat_ent *ent)
|
||||
{
|
||||
- char version[strlen(ent->metadata_version)+1];
|
||||
|
||||
st->subarray[0] = '\0';
|
||||
|
||||
- if (strncmp(ent->metadata_version, "external:", 9) != 0)
|
||||
+ if (ent->metadata_version == NULL ||
|
||||
+ strncmp(ent->metadata_version, "external:", 9) != 0)
|
||||
return;
|
||||
|
||||
- strcpy(version, ent->metadata_version);
|
||||
-
|
||||
- if (is_subarray(&version[9])) {
|
||||
- char *subarray = strrchr(version, '/');
|
||||
+ if (is_subarray(&ent->metadata_version[9])) {
|
||||
+ char version[strlen(ent->metadata_version)+1];
|
||||
+ char *subarray;
|
||||
char *name = &version[10];
|
||||
|
||||
+ strcpy(version, ent->metadata_version);
|
||||
+ subarray = strrchr(version, '/');
|
||||
+ name = &version[10];
|
||||
+
|
||||
if (!subarray)
|
||||
return;
|
||||
*subarray++ = '\0';
|
14
mdadm-3.0.3-intel-serial.patch
Normal file
14
mdadm-3.0.3-intel-serial.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- mdadm-3.0.3/super-intel.c.serial 2009-10-21 20:13:13.000000000 -0400
|
||||
+++ mdadm-3.0.3/super-intel.c 2009-11-05 16:07:28.896089680 -0500
|
||||
@@ -2987,7 +2987,10 @@ static int add_to_super_imsm(struct supe
|
||||
dd->fd = fd;
|
||||
dd->e = NULL;
|
||||
rv = imsm_read_serial(fd, devname, dd->serial);
|
||||
- if (rv) {
|
||||
+ if (rv && check_env("IMSM_DEVNAME_AS_SERIAL")) {
|
||||
+ memset(dd->serial, 0, MAX_RAID_SERIAL_LEN);
|
||||
+ fd2devname(fd, (char *) dd->serial);
|
||||
+ } else if (rv) {
|
||||
fprintf(stderr,
|
||||
Name ": failed to retrieve scsi serial, aborting\n");
|
||||
free(dd);
|
@ -21,7 +21,7 @@ Requires(post): /sbin/service, /sbin/chkconfig
|
||||
Requires(preun): /sbin/service, /sbin/chkconfig
|
||||
Requires(postun): /sbin/service
|
||||
Requires: udev
|
||||
#BuildRequires: glibc-static
|
||||
BuildRequires: glibc-static
|
||||
|
||||
%description
|
||||
The mdadm program is used to create, manage, and monitor Linux MD (software
|
||||
|
@ -83,10 +83,15 @@ condrestart ()
|
||||
}
|
||||
|
||||
|
||||
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 mdadm; RETVAL=$? ;;
|
||||
status) status -p $PIDFILE $prog ; RETVAL=$? ;;
|
||||
restart) restart; RETVAL=$? ;;
|
||||
reload) RETVAL=3 ;;
|
||||
condrestart|try-restart|force-reload) condrestart; RETVAL=$? ;;
|
||||
|
85
raid-check
85
raid-check
@ -15,44 +15,55 @@ case "$CHECK" in
|
||||
*) exit 0;;
|
||||
esac
|
||||
|
||||
active_list=`grep "^md.*: active" /proc/mdstat | cut -f 1 -d ' '`
|
||||
[ -z "$active_list" ] && exit 0
|
||||
|
||||
declare -A check
|
||||
dev_list=""
|
||||
for dev in `grep "^md.*: active" /proc/mdstat | cut -f 1 -d ' '`; do
|
||||
echo $SKIP_DEVS | grep -w $dev >/dev/null 2>&1 && continue
|
||||
if [ -f /sys/block/$dev/md/sync_action ]; then
|
||||
array_state=`cat /sys/block/$dev/md/array_state`
|
||||
sync_action=`cat /sys/block/$dev/md/sync_action`
|
||||
# Only perform the checks on idle, healthy arrays
|
||||
if [ "$array_state" = "clean" -a "$sync_action" = "idle" ]; then
|
||||
check=""
|
||||
echo $REPAIR_DEVS | grep -w $dev >/dev/null 2>&1 && \
|
||||
check="repair"
|
||||
echo $CHECK_DEVS | grep -w $dev >/dev/null 2>&1 \
|
||||
&& check="check"
|
||||
[ -z "$check" ] && check=$CHECK
|
||||
echo "$check" > /sys/block/$dev/md/sync_action
|
||||
[ "$check" = "check" ] && dev_list="$dev_list $dev"
|
||||
fi
|
||||
check_list=""
|
||||
for dev in $active_list; do
|
||||
echo $SKIP_DEVS | grep -w $dev >/dev/null 2>&1 && 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`
|
||||
sync_action=`cat /sys/block/$dev/md/sync_action`
|
||||
if [ "$array_state" = clean -a "$sync_action" = idle ]; then
|
||||
ck=""
|
||||
echo $REPAIR_DEVS | grep -w $dev >/dev/null 2>&1 && ck="repair"
|
||||
echo $CHECK_DEVS | grep -w $dev >/dev/null 2>&1 && ck="check"
|
||||
[ -z "$ck" ] && ck=$CHECK
|
||||
dev_list="$dev_list $dev"
|
||||
check[$dev]=$ck
|
||||
[ "$ck" = "check" ] && check_list="$check_list $dev"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
[ -z "$dev_list" ] && exit 0
|
||||
|
||||
for dev in $dev_list; do
|
||||
echo "${check[$dev]}" > /sys/block/$dev/md/sync_action
|
||||
done
|
||||
[ -z "$check_list" ] && exit 0
|
||||
|
||||
checking=1
|
||||
while [ $checking -ne 0 ]
|
||||
do
|
||||
sleep 60
|
||||
checking=0
|
||||
for dev in $check_list; do
|
||||
sync_action=`cat /sys/block/$dev/md/sync_action`
|
||||
if [ "$sync_action" != "idle" ]; then
|
||||
checking=1
|
||||
fi
|
||||
done
|
||||
done
|
||||
for dev in $check_list; do
|
||||
mismatch_cnt=`cat /sys/block/$dev/md/mismatch_cnt`
|
||||
if [ "$mismatch_cnt" -ne 0 ]; then
|
||||
echo "WARNING: mismatch_cnt is not 0 on /dev/$dev"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$dev_list" ]; then
|
||||
checking=1
|
||||
while [ $checking -ne 0 ]
|
||||
do
|
||||
sleep 3
|
||||
checking=0
|
||||
for dev in $dev_list; do
|
||||
sync_action=`cat /sys/block/$dev/md/sync_action`
|
||||
if [ "$sync_action" != "idle" ]; then
|
||||
checking=1
|
||||
fi
|
||||
done
|
||||
done
|
||||
for dev in $dev_list; do
|
||||
mismatch_cnt=`cat /sys/block/$dev/md/mismatch_cnt`
|
||||
if [ "$mismatch_cnt" -ne 0 ]; then
|
||||
echo "WARNING: mismatch_cnt is not 0 on /dev/$dev"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user