Compare commits

...

No commits in common. 'c9' and 'c8-beta' have entirely different histories.
c9 ... c8-beta

@ -1,151 +0,0 @@
From 476b00bdeeb6c004b3a758bd842b0fa9e4164508 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Mon, 5 Feb 2024 15:50:29 +0100
Subject: [PATCH 1/1] Revert "mdadm: remove container_enough logic"
Mentioned patch changes way of IMSM member arrays assembling, they are
updated by every new drive incremental processes. Previously, member
arrays were created and filled once, by last drive incremental process.
We determined regressions with various impact. Unfortunately, initial
testing didn't show them.
Regressions are connected to drive appearance order and may not be
reproducible on every configuration, there are at least two know
issues for now:
- sysfs attributes are filled using old metadata if there is
outdated drive and it is enumerated first.
- rebuild may be aborted and started from beginning after reboot,
if drive under rebuild is enumerated as the last one.
This reverts commit 4dde420fc3e24077ab926f79674eaae1b71de10b. It fixes
checkpatch issues and reworks logic to remove empty "if" branch in
Incremental.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
Incremental.c | 9 +++++++++
mdadm.h | 7 +++++++
super-ddf.c | 1 +
super-intel.c | 32 +++++++++++++++++++++++++++++++-
4 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/Incremental.c b/Incremental.c
index 6cbc164a27b9..30c07c037028 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1467,6 +1467,15 @@ static int Incremental_container(struct supertype *st, char *devname,
st->ss->getinfo_super(st, &info, NULL);
+ if (info.container_enough < 0 || (info.container_enough == 0 && c->runstop < 1)) {
+ if (c->export)
+ printf("MD_STARTED=no\n");
+ else if (c->verbose)
+ pr_err("Not enough devices to start the container.\n");
+
+ return 0;
+ }
+
match = conf_match(st, &info, devname, c->verbose, &rv);
if (match == NULL && rv == 2)
return rv;
diff --git a/mdadm.h b/mdadm.h
index 709b6104c401..1f28b3e754be 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -377,6 +377,13 @@ struct mdinfo {
int container_member; /* for assembling external-metatdata arrays
* This is to be used internally by metadata
* handler only */
+ /**
+ * flag external handlers can set to indicate that subarrays have:
+ * - not enough disks to start (-1),
+ * - enough disks to start (0),
+ * - all expected disks (1).
+ */
+ int container_enough;
char sys_name[32];
struct mdinfo *devs;
struct mdinfo *next;
diff --git a/super-ddf.c b/super-ddf.c
index a87e3169d325..7571e3b740c6 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -1975,6 +1975,7 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info, char *m
info->array.ctime = DECADE + __be32_to_cpu(*cptr);
info->array.chunk_size = 0;
+ info->container_enough = 1;
info->disk.major = 0;
info->disk.minor = 0;
diff --git a/super-intel.c b/super-intel.c
index 6a664a2e58d3..dbea235dd4bd 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -3778,6 +3778,7 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char *
struct intel_super *super = st->sb;
struct imsm_disk *disk;
int map_disks = info->array.raid_disks;
+ int max_enough = -1;
int i;
struct imsm_super *mpb;
@@ -3819,9 +3820,12 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char *
for (i = 0; i < mpb->num_raid_devs; i++) {
struct imsm_dev *dev = get_imsm_dev(super, i);
- int j = 0;
+ int failed, enough, j, missing = 0;
struct imsm_map *map;
+ __u8 state;
+ failed = imsm_count_failed(super, dev, MAP_0);
+ state = imsm_check_degraded(super, dev, failed, MAP_0);
map = get_imsm_map(dev, MAP_0);
/* any newly missing disks?
@@ -3836,11 +3840,37 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char *
if (!(ord & IMSM_ORD_REBUILD) &&
get_imsm_missing(super, idx)) {
+ missing = 1;
break;
}
}
+
+ if (state == IMSM_T_STATE_FAILED)
+ enough = -1;
+ else if (state == IMSM_T_STATE_DEGRADED &&
+ (state != map->map_state || missing))
+ enough = 0;
+ else /* we're normal, or already degraded */
+ enough = 1;
+ if (is_gen_migration(dev) && missing) {
+ /* during general migration we need all disks
+ * that process is running on.
+ * No new missing disk is allowed.
+ */
+ max_enough = -1;
+ enough = -1;
+ /* no more checks necessary
+ */
+ break;
+ }
+ /* in the missing/failed disk case check to see
+ * if at least one array is runnable
+ */
+ max_enough = max(max_enough, enough);
}
+ info->container_enough = max_enough;
+
if (super->disks) {
__u32 reserved = imsm_reserved_sectors(super, super->disks);
--
2.32.0 (Apple Git-132)

@ -1,42 +0,0 @@
From 582945c2d3bbead4a71de521a392e292a4a84e24 Mon Sep 17 00:00:00 2001
From: Pawel Piatkowski <pawel.piatkowski@intel.com>
Date: Wed, 20 Dec 2023 10:32:49 +0100
Subject: [PATCH 1/1] manage: adjust checking subarray state in update_subarray
Only changing bitmap related consistency_policy requires
subarray to be inactive.
consistency_policy with PPL or NO_PPL value can be changed on
active subarray.
It fixes regression introduced in commit
db10eab68e652f141169 ("Fix --update-subarray on active volume")
Signed-off-by: Pawel Piatkowski <pawel.piatkowski@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
Manage.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Manage.c b/Manage.c
index f0d4cb01..91532266 100644
--- a/Manage.c
+++ b/Manage.c
@@ -1749,6 +1749,7 @@ int Update_subarray(char *dev, char *subarray, enum update_opt update,
int fd, rv = 2;
struct mdinfo *info = NULL;
char *update_verb = map_num(update_options, update);
+ bool allow_active = update == UOPT_PPL || update == UOPT_NO_PPL;
memset(st, 0, sizeof(*st));
@@ -1763,7 +1764,7 @@ int Update_subarray(char *dev, char *subarray, enum update_opt update,
goto free_super;
}
- if (is_subarray_active(subarray, st->devnm)) {
+ if (!allow_active && is_subarray_active(subarray, st->devnm)) {
if (verbose >= 0)
pr_err("Subarray %s in %s is active, cannot update %s\n",
subarray, dev, update_verb);
--
2.41.0

@ -1,61 +0,0 @@
From ea2ca7ed3dbbf881ce08d80fe371f2aaf05011c3 Mon Sep 17 00:00:00 2001
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
Date: Thu, 18 Jan 2024 11:30:18 +0100
Subject: [PATCH 1/1] Grow: Move update_tail assign to Grow_reshape()
Due to e919fb0af245 ("FIX: Enable metadata updates for raid0") code
can't enter super-intel.c:3415, resulting in checkpoint not being
saved to metadata for second volume in matrix raid array.
This results in checkpoint being stuck at last value for the
first volume.
Move st->update_tail to Grow_reshape() so it is assigned for each
volume.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
Grow.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Grow.c b/Grow.c
index f95dae82..5498e54f 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2085,9 +2085,10 @@ int Grow_reshape(char *devname, int fd,
if (!mdmon_running(st->container_devnm))
start_mdmon(st->container_devnm);
ping_monitor(container);
- if (mdmon_running(st->container_devnm) &&
- st->update_tail == NULL)
- st->update_tail = &st->updates;
+ if (mdmon_running(st->container_devnm) == false) {
+ pr_err("No mdmon found. Grow cannot continue.\n");
+ goto release;
+ }
}
if (s->size == MAX_SIZE)
@@ -3048,6 +3049,8 @@ static int reshape_array(char *container, int fd, char *devname,
dprintf("Cannot get array information.\n");
goto release;
}
+ if (st->update_tail == NULL)
+ st->update_tail = &st->updates;
if (array.level == 0 && info->component_size == 0) {
get_dev_size(fd, NULL, &array_size);
info->component_size = array_size / array.raid_disks;
@@ -5152,9 +5155,7 @@ int Grow_continue_command(char *devname, int fd,
start_mdmon(container);
ping_monitor(container);
- if (mdmon_running(container))
- st->update_tail = &st->updates;
- else {
+ if (mdmon_running(container) == false) {
pr_err("No mdmon found. Grow cannot continue.\n");
ret_val = 1;
goto Grow_continue_command_exit;
--
2.41.0

@ -1,55 +0,0 @@
From b0f4e8e30f38d83f7e3f53d01d72d4cb3b4d42d7 Mon Sep 17 00:00:00 2001
From: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
Date: Tue, 7 May 2024 05:38:55 +0200
Subject: [PATCH 1/2] util.c: change devnm to const in mdmon functions
Devnm shall not be changed inside mdmon_running()
and mdmon_pid() functions, change this parameter to const.
Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
mdadm.h | 4 ++--
util.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/mdadm.h b/mdadm.h
index 2ff3e463..1ba541fc 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1768,8 +1768,8 @@ extern int is_subarray_active(char *subarray, char *devname);
extern int open_subarray(char *dev, char *subarray, struct supertype *st, int quiet);
extern struct superswitch *version_to_superswitch(char *vers);
-extern int mdmon_running(char *devnm);
-extern int mdmon_pid(char *devnm);
+extern int mdmon_running(const char *devnm);
+extern int mdmon_pid(const char *devnm);
extern int check_env(char *name);
extern __u32 random32(void);
extern void random_uuid(__u8 *buf);
diff --git a/util.c b/util.c
index 4fbf11c4..e2b490e1 100644
--- a/util.c
+++ b/util.c
@@ -1902,7 +1902,7 @@ unsigned long long min_recovery_start(struct mdinfo *array)
return recovery_start;
}
-int mdmon_pid(char *devnm)
+int mdmon_pid(const char *devnm)
{
char path[100];
char pid[10];
@@ -1922,7 +1922,7 @@ int mdmon_pid(char *devnm)
return atoi(pid);
}
-int mdmon_running(char *devnm)
+int mdmon_running(const char *devnm)
{
int pid = mdmon_pid(devnm);
if (pid <= 0)
--
2.41.0

@ -1,121 +0,0 @@
From aa1cc5815d2b14a8b47add18cfaa8264e19c10ce Mon Sep 17 00:00:00 2001
From: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
Date: Tue, 7 May 2024 05:38:56 +0200
Subject: [PATCH 2/2] Wait for mdmon when it is stared via systemd
When mdmon is being started it may need few seconds to start.
For now, we didn't wait for it. Introduce wait_for_mdmon()
function, which waits up to 5 seconds for mdmon to start completely.
Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
Assemble.c | 4 ++--
Grow.c | 7 ++++---
mdadm.h | 2 ++
util.c | 29 +++++++++++++++++++++++++++++
4 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/Assemble.c b/Assemble.c
index f5e9ab1f..83dced19 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -2173,8 +2173,8 @@ int assemble_container_content(struct supertype *st, int mdfd,
if (!mdmon_running(st->container_devnm))
start_mdmon(st->container_devnm);
ping_monitor(st->container_devnm);
- if (mdmon_running(st->container_devnm) &&
- st->update_tail == NULL)
+ if (wait_for_mdmon(st->container_devnm) == MDADM_STATUS_SUCCESS &&
+ !st->update_tail)
st->update_tail = &st->updates;
}
diff --git a/Grow.c b/Grow.c
index 87ed9214..1923c27c 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2134,7 +2134,7 @@ int Grow_reshape(char *devname, int fd,
if (!mdmon_running(st->container_devnm))
start_mdmon(st->container_devnm);
ping_monitor(container);
- if (mdmon_running(st->container_devnm) == false) {
+ if (wait_for_mdmon(st->container_devnm) != MDADM_STATUS_SUCCESS) {
pr_err("No mdmon found. Grow cannot continue.\n");
goto release;
}
@@ -3218,7 +3218,8 @@ static int reshape_array(char *container, int fd, char *devname,
if (!mdmon_running(container))
start_mdmon(container);
ping_monitor(container);
- if (mdmon_running(container) && st->update_tail == NULL)
+ if (wait_for_mdmon(container) == MDADM_STATUS_SUCCESS &&
+ !st->update_tail)
st->update_tail = &st->updates;
}
}
@@ -5173,7 +5174,7 @@ int Grow_continue_command(char *devname, int fd, struct context *c)
start_mdmon(container);
ping_monitor(container);
- if (mdmon_running(container) == false) {
+ if (wait_for_mdmon(container) != MDADM_STATUS_SUCCESS) {
pr_err("No mdmon found. Grow cannot continue.\n");
ret_val = 1;
goto Grow_continue_command_exit;
diff --git a/mdadm.h b/mdadm.h
index 1ba541fc..b71d7b32 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1770,6 +1770,8 @@ extern struct superswitch *version_to_superswitch(char *vers);
extern int mdmon_running(const char *devnm);
extern int mdmon_pid(const char *devnm);
+extern mdadm_status_t wait_for_mdmon(const char *devnm);
+
extern int check_env(char *name);
extern __u32 random32(void);
extern void random_uuid(__u8 *buf);
diff --git a/util.c b/util.c
index e2b490e1..bf79742f 100644
--- a/util.c
+++ b/util.c
@@ -1932,6 +1932,35 @@ int mdmon_running(const char *devnm)
return 0;
}
+/*
+ * wait_for_mdmon() - Waits for mdmon within specified time.
+ * @devnm: Device for which mdmon should start.
+ *
+ * Function waits for mdmon to start. It may need few seconds
+ * to start, we set timeout to 5, it should be sufficient.
+ * Do not wait if mdmon has been started.
+ *
+ * Return: MDADM_STATUS_SUCCESS if mdmon is running, error code otherwise.
+ */
+mdadm_status_t wait_for_mdmon(const char *devnm)
+{
+ const time_t mdmon_timeout = 5;
+ time_t start_time = time(0);
+
+ if (mdmon_running(devnm))
+ return MDADM_STATUS_SUCCESS;
+
+ pr_info("Waiting for mdmon to start\n");
+ while (time(0) - start_time < mdmon_timeout) {
+ sleep_for(0, MSEC_TO_NSEC(200), true);
+ if (mdmon_running(devnm))
+ return MDADM_STATUS_SUCCESS;
+ };
+
+ pr_err("Timeout waiting for mdmon\n");
+ return MDADM_STATUS_ERROR;
+}
+
int start_mdmon(char *devnm)
{
int i;
--
2.41.0

@ -1,27 +0,0 @@
#
# Enable/Disable - default is Disabled
# to disable this rule, GOTO="md_end" should be the first active command.
# to enable this rule, Comment out GOTO="md_end".
GOTO="md_end"
# Required: MD arrays must have a bitmap for transient devices to
# be added back in the array.
# mdadm -CR /dev/md0 -l1 -n2 /dev/sd[ab] bitmap=internal
# 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}=="1", GOTO="md_end"
# We process add events on block devices (since they are ready as soon as
# they are added to the system)
ACTION!="add", GOTO="md_end"
ENV{ID_FS_TYPE}!="linux_raid_member", GOTO="md_end"
SUBSYSTEM=="block", RUN{program}+="/usr/sbin/md-auto-readd.sh $devnode"
#
# Land here to exit cleanly
LABEL="md_end"

@ -1,17 +0,0 @@
#!/usr/bin/bash
MDADM=/sbin/mdadm
DEVNAME=$1
export $(${MDADM} --examine --export ${DEVNAME})
if [ -z "${MD_UUID}" ]; then
exit 1
fi
UUID_LINK=$(readlink /dev/disk/by-id/md-uuid-${MD_UUID})
MD_DEVNAME=${UUID_LINK##*/}
export $(${MDADM} --detail --export /dev/${MD_DEVNAME})
if [ -z "${MD_METADATA}" ] ; then
exit 1
fi
${MDADM} --manage /dev/${MD_DEVNAME} --re-add ${DEVNAME} --verbose

@ -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

@ -125,13 +125,11 @@ do
do
eval fl=\$MD_${i}_fl
eval sys=\$MD_${i}_sys
eval dev=\$MD_${i}_dev
if [ -z "$fl" ]; then continue; fi
if [ "`cat $sys/md/sync_action`" != 'check' ]
then
logger -p daemon.info mdcheck finished checking $dev
eval MD_${i}_fl=
rm -f $fl
continue;
@ -140,7 +138,13 @@ do
echo $a > $fl
any=yes
done
if [ -z "$any" ]; then exit 0; fi
if [ -z "$any" ]; then
#mdcheck_continue.timer is started by mdcheck_start.timer.
#When he check action can be finished in mdcheck_start.service,
#it doesn't need mdcheck_continue anymore.
systemctl stop mdcheck_continue.timer
exit 0;
fi
sleep 120
done

@ -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

@ -4,9 +4,9 @@ ConditionPathExists=/etc/mdadm.conf
[Service]
Type=forking
PIDFile=/run/mdadm/mdadm.pid
PIDFile=/var/run/mdadm/mdadm.pid
EnvironmentFile=-/etc/sysconfig/mdmonitor
ExecStart=/sbin/mdadm --monitor --scan --syslog -f --pid-file=/run/mdadm/mdadm.pid
ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid
[Install]
WantedBy=multi-user.target

@ -1,6 +0,0 @@
[Unit]
Description=RAID setup health check
[Service]
Type=oneshot
ExecStart=/usr/sbin/raid-check

@ -1,10 +0,0 @@
[Unit]
Description=Weekly RAID setup health check
[Timer]
OnCalendar=Sun *-*-* 01:00:00
Persistent=true
AccuracySec=24h
[Install]
WantedBy=timers.target

@ -0,0 +1,12 @@
--- mdadm/super1-orig.c 2023-11-10 19:27:25.262178162 +0800
+++ mdadm/super1.c 2023-11-10 19:28:25.991441827 +0800
@@ -1988,8 +1988,7 @@
long bm_offset;
bool raid0_need_layout = false;
- /* Since linux kernel v5.4, raid0 always has a layout */
- if (has_raid0_layout(sb) && get_linux_version() >= 5004000)
+ if (has_raid0_layout(sb))
raid0_need_layout = true;
for (di = st->info; di; di = di->next) {

@ -1,23 +1,18 @@
Summary: The mdadm program controls Linux md devices (software RAID arrays)
Name: mdadm
Version: 4.2
# extraversion is used to define rhel internal version
%define extraversion 14
%define extraversion 13
Release: %{extraversion}%{?dist}
Summary: The mdadm program controls Linux md devices (software RAID arrays)
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
License: GPLv2+
Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}%{?subversion:-%{subversion}}.tar.xz
Source1: raid-check
Source2: mdadm-raid-check-sysconfig
Source3: mdmonitor.service
Source4: mdadm.conf
Source5: mdadm_event.conf
Source6: raid-check.timer
Source7: raid-check.service
Source1: mdmonitor.init
Source2: raid-check
Source3: mdadm-raid-check-sysconfig
Source4: mdadm-cron
Source5: mdmonitor.service
Source6: mdadm.conf
Source7: mdadm_event.conf
Source8: mdcheck
Source9: md-auto-readd.rule
Source10: md-auto-readd.sh
Patch000: 0001-Unify-error-message.patch
Patch001: 0002-mdadm-Fix-double-free.patch
@ -184,23 +179,26 @@ Patch161: 0162-mdadm-ddf-Abort-when-raid-disk-is-smaller-in-getinfo.patch
Patch162: 0163-mdadm-super1-Add-MD_FEATURE_RAID0_LAYOUT-if-kernel-5.patch
Patch163: 0164-mdadm-remove-container_enough-logic.patch
Patch164: 0165-Fix-assembling-RAID-volume-by-using-incremental.patch
Patch165: 0166-Revert-mdadm-remove-container_enough-logic.patch
Patch166: 0167-manage-adjust-checking-subarray-state-in-update_suba.patch
Patch167: 0168-Grow-Move-update_tail-assign-to-Grow_reshape.patch
Patch168: 0169-util.c-change-devnm-to-const-in-mdmon-functions.patch
Patch169: 0170-Wait-for-mdmon-when-it-is-stared-via-systemd.patch
# Fedora customization patches
# RHEL customization patches
Patch200: mdadm-udev.patch
Patch201: mdadm-2.5.2-static.patch
Patch202: raid0-layout.patch
BuildRequires: make
BuildRequires: systemd-rpm-macros binutils-devel gcc systemd-devel
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 < 034-1
Requires(post): systemd-units chkconfig coreutils
BuildRequires: systemd-units binutils-devel systemd-devel
Requires(preun): systemd-units
Requires(postun): systemd-units coreutils
Requires: libreport-filesystem
Requires(post): systemd coreutils
Requires(preun): systemd
Requires(postun): systemd coreutils
%define _hardened_build 1
%description
The mdadm program is used to create, manage, and monitor Linux MD (software
@ -213,199 +211,215 @@ file can be used to help with some common tasks.
%autosetup -p1 -n %{name}-%{version}%{?subversion:_%{subversion}}
%build
#If extraversion is defined, add EXTRAVERSION="%{extraversion}"
make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" SYSCONFDIR="%{_sysconfdir}" EXTRAVERSION="%{extraversion}" mdadm mdmon
%install
make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} UDEVDIR=/usr/lib/udev/ install install-systemd
install -Dp -m 755 %{SOURCE1} %{buildroot}%{_sbindir}/raid-check
install -Dp -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/raid-check
mkdir -p -m 710 %{buildroot}/run/mdadm
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}%{_sysconfdir}/sysconfig/raid-check
install -Dp -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/cron.d/raid-check
mkdir -p -m 710 %{buildroot}/var/run/mdadm
mkdir -p -m 700 %{buildroot}/usr/share/mdadm
mkdir -p -m 700 %{buildroot}/usr/lib/mdadm
install -Dp -m 755 %{SOURCE8} %{buildroot}/usr/share/mdadm/mdcheck
install -Dp -m 644 %{SOURCE9} %{buildroot}%{_udevrulesdir}/66-md-auto-readd.rules
install -Dp -m 755 %{SOURCE10} %{buildroot}%{_sbindir}/md-auto-readd.sh
# systemd
mkdir -p %{buildroot}%{_unitdir}
install -m644 %{SOURCE3} %{buildroot}%{_unitdir}
install -m644 %{SOURCE6} %{buildroot}%{_unitdir}
install -m644 %{SOURCE7} %{buildroot}%{_unitdir}
install -m644 %{SOURCE5} %{buildroot}%{_unitdir}
# tmpfile
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
install -m 0644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/%{name}.conf
mkdir -p %{buildroot}%{_localstatedir}/run/
install -d -m 0710 %{buildroot}/run/%{name}/
install -d -m 0710 %{buildroot}%{_localstatedir}/run/%{name}/
# abrt
mkdir -p %{buildroot}/etc/libreport/events.d
install -m644 %{SOURCE5} %{buildroot}/etc/libreport/events.d
install -m644 %{SOURCE7} %{buildroot}/etc/libreport/events.d
%clean
rm -rf %{buildroot}
%post
%systemd_post mdmonitor.service raid-check.timer
%{_bindir}/systemctl disable mdmonitor-takeover.service >/dev/null 2>&1 || :
%systemd_post mdmonitor.service
/usr/bin/systemctl disable mdmonitor-takeover.service >/dev/null 2>&1 || :
%preun
%systemd_preun mdmonitor.service raid-check.timer
%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
%license COPYING
%doc mdadm.conf-example misc/*
%defattr(-,root,root,-)
%doc TODO ChangeLog mdadm.conf-example COPYING misc/*
%{_udevrulesdir}/*
%{_sbindir}/*
%{_unitdir}/*
%{_mandir}/man*/md*
%{_prefix}/lib/systemd/system-shutdown/*
%config(noreplace) %{_sysconfdir}/cron.d/*
%config(noreplace) %{_sysconfdir}/sysconfig/*
%dir /run/%{name}/
%dir %{_localstatedir}/run/%{name}/
%config(noreplace) %{_tmpfilesdir}/%{name}.conf
/etc/libreport/events.d/*
/usr/share/mdadm/mdcheck
%changelog
* Mon Jul 15 2024 Xiao Ni <xni@redhat.com> 4.2-14
- IMSM raid0 can't grow
- Resolves RHEL-39990
* Fri Nov 10 2023 Xiao Ni <xni@redhat.com> - 4.2-13
- Fix raid0 layout display problem
- Resolves RHEL-8372
* Tue Apr 30 2024 Xiao Ni <xni@redhat.com> 4.2-13
- consistency-policy cannot be changed on active volume
- Resolves RHEL-34763
* Tue Nov 7 2023 Xiao Ni <xni@redhat.com> - 4.2-12
- Fix rpminspect check error from gating test
- Resolves RHEL-15388
* Wed Mar 20 2024 Xiao Ni <xni@redhat.com> 4.2-12
- To fix errata/osci problems
- Resolves RHEL-26272
* Mon Nov 6 2023 Xiao Ni <xni@redhat.com> - 4.2-11
- Update extraversion again
- Resolves RHEL-15388
* Fri Mar 15 2024 Xiao Ni <xni@redhat.com> 4.2-11
- revert "mdadm: remove container_enough logic"
- Resolves RHEL-26272
* Mon Nov 6 2023 Xiao Ni <xni@redhat.com> - 4.2-10
- Update extraversion
- Resolves RHEL-15388
* Fri Nov 3 2023 Xiao Ni <xni@redhat.com> - 4.2-10
* Sat Nov 4 2023 Xiao Ni <xni@redhat.com> - 4.2-9
- Update to latest upstream
- Resolves RHEL-15386
- Resolves RHEL-15388
* Tue May 16 2023 Xiao Ni <xni@redhat.com> - 4.2-9
- Update to latest upstream and fix mdcheck service bug
- Resolves rhbz#2159923, rhbz#2150865, rhbz#2124071, rhbz#2203859
- Resolves rhbz#2116418, rhbz#2150862, rhbz#2159584
* Fri Jan 6 2023 Xiao Ni <xni@redhat.com> - 4.2-8
- Update to latest upstream
- Resolves rhbz#2127101, rhbz#2139789, rhbz#2149292, rhbz#2151209, rhbz#2148945
* Tue Nov 15 2022 Xiao Ni <xni@redhat.com> - 4.2-7
- Update to latest upstream and keep udev rule close to upstream
- Resolves rhbz#2107147, rhbz#2129087, rhbz#2126428
* Fri Jan 6 2023 Xiao Ni <xni@redhat.com> - 4.2-7
- Update to latest to upstream to fix some bugs
- Resolves rhbz#2149307, rhbz#2149473, rhbz#2151208, rhbz#2127096
* Mon Sep 5 2022 Xiao Ni <xni@redhat.com> - 4.2-6
- Add ddf auto-assemble in mdadm udev rule
- Resolves rhbz#2120690
* Thu Sep 8 2022 Xiao Ni <xni@redhat.com> - 4.2-6
- Keep udev rule close to upstream and update to latest upstream
- Resolves rhbz#1991596, rhbz#2129088, rhbz#2107150
* Thu Aug 25 2022 Xiao Ni <xni@redhat.com> - 4.2-5
- Update to latest upstream
- Resolves rhbz#2092330
- Update mdadm to latest upstream
- Resolves rhbz#2092326
* Wed Aug 10 2022 Xiao Ni <xni@redhat.com> - 4.2-4
- Add Killmode=none for mdmon systemd service again
- Resolves rhbz#2109042
* Sun Aug 07 2022 Xiao Ni <xni@redhat.com> - 4.2-4
- Add KillMode=none to mdmon systemd service again
- Resolves rhbz#2109397
* Mon May 30 2022 Xiao Ni <xni@redhat.com> - 4.2-3
- Update mdadm to latest upstream
- Resolves rhbz#2052029, rhbz#1974184
- Resolves rhbz#2052563, rhbz#1991596
* Thu Feb 24 2022 Xiao Ni <xni@redhat.com> - 4.2-2
- mdadm re-add fault/removed disk failed
- Resolves rhbz#2047567
- Resolves rhbz#2046323
* Fri Feb 18 2022 Xiao Ni <xni@redhat.com> - 4.2
- Update to 4.2
- Resolves rhbz#2034809
* Fri Dec 31 2021 Xiao Ni <xni@redhat.com> - 4.2
- Update to upstream 4.2
- Resolves rhbz#2026723, rhbz#2026532, rhbz#1995587
* Mon Nov 08 2021 Xiao Ni <xni@redhat.com> - 4.2-rc3
- Update to 4.2-rc3
- Resolves rhbz#1983019, rhbz#1995582, rhbz#1972032, rhbz#1885665
* Fri Aug 13 2021 Xiao Ni <xni@redhat.com> - 4.2-rc2_1.2
- Fix gating test error and rpminspect error
- Resolves rhbz#1870487, rhbz#1880529
* Thu Aug 05 2021 Xiao Ni <xni@redhat.com> - 4.2-rc2
- Update to 4.2-rc2
- Resolves rhbz#1989844
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 4.2-rc2_1.1
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Jul 23 2021 Xiao Ni <xni@redhat.com> - 4.2-rc1-4
- Fix gating test failure
- Resolves rhbz#1984335
* Mon Aug 09 2021 Xiao Ni <xni@redhat.com> - 4.2-rc2_1
- Update to mdadm-4.2-rc2
- Resolves rhbz#1870487, rhbz#1880529
* Tue Jul 20 2021 Xiao Ni <xni@redhat.com> - 4.2-rc1-3
- Fix super1.0 offset problem and super imsm bugs
- Resolves rhbz#1966712 and rhbz#1975449
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 4.1-8
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu Jun 10 2021 Xiao Ni <xni@redhat.com> - 4.2-rc1-2
- Fix udev rule syntax error
- Resolves rhbz#1945780
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri May 07 2021 Xiao Ni <xni@redhat.com> - 4.2-rc1
- Update to upstream 4.2-rc1
- Resovles rhbz#1920384
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jan 11 2021 Xiao Ni <xni@redhat.com> - 4.1.15
- Update to latest upstream
- Resolves rhbz#1838005
* Wed May 27 2020 Xiao Ni <xni@redhat.com> - 4.1-5
- Don't enable raid-check.service to avoid raid check after every boot
- Resolves bz1838409
* Fri Jun 05 2020 Xiao Ni <xni@redhat.com> - 4.1.14
- Update to latest upstream
- Resolves rhbz#1780501
* Sun Mar 08 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 4.1-4
- Fix install location of udev rules (rhbz 1809117)
* Fri Feb 28 2020 Xiao Ni <xni@redhat.com> - 4.1.13
- Remove the unnecessary whitespace in .service file
- Resolves rhbz#1803470
* Fri Feb 07 2020 Alejandro Domínguez Muñoz <adomu@net-c.com> - 4.1-3
- Replace raid-check cron job with systemd timer
* Tue Feb 11 2020 Xiao Ni <xni@redhat.com> - 4.1.12
- Update mdadm to latest upstream && change tmpfiles directory && correct changelog date
- Resolves rhbz#1800521 and rhbz#1657265
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Feb 09 2020 Xiao Ni <xni@redhat.com> - 4.1.11
- mdcheck start service can't start
- Resolves rhbz#1769823
* Mon Jan 13 2020 Peter Robinson <pbrobinson@fedoraproject.org> 4.1-1
- Update to 4.1 GA
- Spec cleanups and updates
- Update mdadm.pid location (rhbz 1701114, rhbz 1557623, rhbz 1557623)
* Fri Nov 15 2019 Xiao Ni <xni@redhat.com> - 4.1.10
- Update mdadm to latest upstream
- Resolves rhbz#1721937
* Sun Dec 15 2019 Julian Sikorski <belegdol@fedoraproject.org> - 4.1-rc2.0.5.2
- Fix invalid substitution type error
- Resolves bz1740662, bz1749859
* Wed Jul 10 2019 Xiao Ni <xni@redhat.com> - 4.1.9
- Add --incremental for ddf member disk in udev rule
- Resolves rhbz#1693583
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-rc2.0.5.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jun 13 2019 Xiao Ni <xni@redhat.com> - 4.1.8
- Update to latest upstream
- Resolves rhbz#1661203
* Tue Jun 04 2019 Xiao Ni <xni@redhat.com> - 4.1-rc2.0.5
- Update tmpfiles directory to non-legacy location
- Resolves bz1704517
* Wed Jun 12 2019 Xiao Ni <xni@redhat.com> - 4.1.7
- Fix gating test error
- Resolves rhbz#1682396
* Wed Apr 17 2019 Xiao Ni <xni@redhat.com> - 4.1-rc2.0.4
- Change tmpfiles directory to /run/mdadm
- Resovles bz1701821
* Thu May 23 2019 Xiao Ni <xni@redhat.com> - 4.1.6
- Enable raid5 journal
- Resolves rhbz#1691202
* Sat Mar 16 2019 Björn Esser <besser82@fedoraproject.org> - 4.1-rc2.0.3
- Add patch to build without -Werror, fixes FTBFS (#1675363)
* Fri Apr 12 2019 Xiao Ni <xni@redhat.com> - 4.1.5
- add gating tests
- Resolves rhbz#1682396
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-rc2.0.2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jan 11 2019 Xiao Ni <xni@redhat.com> - 4.1.4
- Disable raid5 journal
- Resolves rhbz#1664961
* Thu Sep 13 2018 Adam Williamson <awilliam@redhat.com> - 4.1-rc2.0.2
- Fix multipath check in udev rule, broke array init in F29
- Resolves bz1628192
* Fri Dec 21 2018 Xiao Ni <xni@redhat.com> - 4.1.3
- Recovery isn't noticed while raid10 double degradation
- Resolves rhbz#1654482
* Sun Aug 26 2018 Peter Robinson <pbrobinson@fedoraproject.org> 4.1-rc2.0.1
- Update to 4.1 rc2
* Wed Dec 12 2018 Xiao Ni <xni@redhat.com> - 4.1.2
- Add warning message for using raid1 cluster
- Resolves rhbz#1654482
* Fri Jul 20 2018 Xiao Ni <xni@redhat.com> - 4.1-rc1_1.2
- Add gcc into BuildRequires
- Resolves bz1604811
* Fri Oct 26 2018 Xiao Ni <xni@redhat.com> - 4.1.1
- Update to upstream 4.1
- Resolves rhbz#1642206
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-rc1_1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Oct 24 2018 Xiao Ni <xni@redhat.com> - 4.1-rc1-3
- Can't find md device when install rhel8
- Resolves rhbz#1628774
* Mon Jul 09 2018 Xiao Ni <xni@redhat.com> 4.1-rc1-1
- Update to latest upstream version 4.1-rc1
- Resolves bz1556591
* Wed Jul 4 2018 Peter Robinson <pbrobinson@fedoraproject.org> 4.0-7
- Cleanup spec, use %%licenece, drop old sys-v migration bits
* Thu Aug 16 2018 Xiao Ni <xni@redhat.com> - 4.1-rc1-2
- Fix two IMSM bugs
- Resolves rhbz#1602420 and rhbz#1602422
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Jun 22 2018 Xiao Ni <xni@redhat.com> - 4.1-rc1-1
- Upgrade to upstream mdadm-4.1-rc1
- Resolves rhbz#1493605 and rhbz#1494477 and rhbz#1502118
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

Loading…
Cancel
Save