forked from pool/mdadm
Compare commits
19 Commits
Author | SHA256 | Date | |
---|---|---|---|
6b3841dbd8 | |||
61306f0987 | |||
3ffc369e1d | |||
1b8ed28186 | |||
90146d9161 | |||
045af51d81 | |||
55720a3abd | |||
f691ff9e13 | |||
2fd0f7abdc | |||
f62486438f | |||
5178f22379 | |||
1bcba85eb0 | |||
2466cc244a | |||
2ee57c3410 | |||
7349532f03 | |||
bcd20d35f5 | |||
|
47f51bd5ec | ||
d61034bb43 | |||
|
ca78f33aa3 |
@@ -1,68 +0,0 @@
|
||||
From aec3b907de48be54106600a1ecb69d1231f4801d Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
|
||||
Date: Thu, 18 Jan 2024 11:30:15 +0100
|
||||
Subject: [PATCH 1/5] Remove hardcoded checkpoint interval checking
|
||||
Git-commit: aec3b907de48be54106600a1ecb69d1231f4801d
|
||||
Patch-mainline: mdadm-4.3+
|
||||
References: jsc#PED-7542
|
||||
|
||||
Mdmon assumes that kernel marks checkpoint every 1/16 of the volume size
|
||||
and that the checkpoints are equal in size. This is not true, kernel may
|
||||
mark checkpoints more frequently depending on several factors, including
|
||||
sync speed. This results in checkpoints reported by mdadm --examine
|
||||
falling behind the one reported by kernel.
|
||||
|
||||
Remove hardcoded checkpoint interval checking.
|
||||
|
||||
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
|
||||
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
monitor.c | 22 ++++++----------------
|
||||
1 file changed, 6 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/monitor.c b/monitor.c
|
||||
index 4acec67..b8d9e88 100644
|
||||
--- a/monitor.c
|
||||
+++ b/monitor.c
|
||||
@@ -564,22 +564,10 @@ static int read_and_act(struct active_array *a, fd_set *fds)
|
||||
}
|
||||
}
|
||||
|
||||
- /* Check for recovery checkpoint notifications. We need to be a
|
||||
- * minimum distance away from the last checkpoint to prevent
|
||||
- * over checkpointing. Note reshape checkpointing is handled
|
||||
- * in the second branch.
|
||||
+ /* Handle reshape checkpointing
|
||||
*/
|
||||
- if (sync_completed > a->last_checkpoint &&
|
||||
- sync_completed - a->last_checkpoint > a->info.component_size >> 4 &&
|
||||
- a->curr_action > reshape) {
|
||||
- /* A (non-reshape) sync_action has reached a checkpoint.
|
||||
- * Record the updated position in the metadata
|
||||
- */
|
||||
- a->last_checkpoint = sync_completed;
|
||||
- a->container->ss->set_array_state(a, a->curr_state <= clean);
|
||||
- } else if ((a->curr_action == idle && a->prev_action == reshape) ||
|
||||
- (a->curr_action == reshape &&
|
||||
- sync_completed > a->last_checkpoint)) {
|
||||
+ if ((a->curr_action == idle && a->prev_action == reshape) ||
|
||||
+ (a->curr_action == reshape && sync_completed > a->last_checkpoint)) {
|
||||
/* Reshape has progressed or completed so we need to
|
||||
* update the array state - and possibly the array size
|
||||
*/
|
||||
@@ -607,8 +595,10 @@ static int read_and_act(struct active_array *a, fd_set *fds)
|
||||
a->last_checkpoint = sync_completed;
|
||||
}
|
||||
|
||||
- if (sync_completed > a->last_checkpoint)
|
||||
+ if (sync_completed > a->last_checkpoint) {
|
||||
a->last_checkpoint = sync_completed;
|
||||
+ a->container->ss->set_array_state(a, a->curr_state <= clean);
|
||||
+ }
|
||||
|
||||
if (sync_completed >= a->info.component_size)
|
||||
a->last_checkpoint = 0;
|
||||
--
|
||||
2.35.3
|
||||
|
@@ -1,100 +0,0 @@
|
||||
From cf87fe75fd83dac008ea116c2c52ec69783fdf6a Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
|
||||
Date: Thu, 18 Jan 2024 11:30:16 +0100
|
||||
Subject: [PATCH 2/5] monitor: refactor checkpoint update
|
||||
Git-commit: cf87fe75fd83dac008ea116c2c52ec69783fdf6a
|
||||
Patch-mainline: mdadm-4.3+
|
||||
References: jsc#PED-7542
|
||||
|
||||
"if" statements of checkpoint updates have too many responsibilties.
|
||||
This results in unclear code flow and duplicated code.
|
||||
|
||||
Refactor checkpoint update code and simplify "if" statements.
|
||||
|
||||
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
|
||||
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
monitor.c | 51 +++++++++++++++++++++++++--------------------------
|
||||
1 file changed, 25 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/monitor.c b/monitor.c
|
||||
index b8d9e88..be0bec7 100644
|
||||
--- a/monitor.c
|
||||
+++ b/monitor.c
|
||||
@@ -412,6 +412,7 @@ static int read_and_act(struct active_array *a, fd_set *fds)
|
||||
int ret = 0;
|
||||
int count = 0;
|
||||
struct timeval tv;
|
||||
+ bool write_checkpoint = false;
|
||||
|
||||
a->next_state = bad_word;
|
||||
a->next_action = bad_action;
|
||||
@@ -564,40 +565,38 @@ static int read_and_act(struct active_array *a, fd_set *fds)
|
||||
}
|
||||
}
|
||||
|
||||
- /* Handle reshape checkpointing
|
||||
- */
|
||||
- if ((a->curr_action == idle && a->prev_action == reshape) ||
|
||||
- (a->curr_action == reshape && sync_completed > a->last_checkpoint)) {
|
||||
- /* Reshape has progressed or completed so we need to
|
||||
- * update the array state - and possibly the array size
|
||||
- */
|
||||
+ /* Update reshape checkpoint, depending if it finished or progressed */
|
||||
+ if (a->curr_action == idle && a->prev_action == reshape) {
|
||||
+ char buf[SYSFS_MAX_BUF_SIZE];
|
||||
+
|
||||
if (sync_completed != 0)
|
||||
a->last_checkpoint = sync_completed;
|
||||
- /* We might need to update last_checkpoint depending on
|
||||
- * the reason that reshape finished.
|
||||
- * if array reshape is really finished:
|
||||
- * set check point to the end, this allows
|
||||
- * set_array_state() to finalize reshape in metadata
|
||||
- * if reshape if broken: do not set checkpoint to the end
|
||||
- * this allows for reshape restart from checkpoint
|
||||
+
|
||||
+ /*
|
||||
+ * If reshape really finished, set checkpoint to the end to finalize it.
|
||||
+ * Do not set checkpoint if reshape is broken.
|
||||
+ * Reshape will restart from last checkpoint.
|
||||
*/
|
||||
- if ((a->curr_action != reshape) &&
|
||||
- (a->prev_action == reshape)) {
|
||||
- char buf[SYSFS_MAX_BUF_SIZE];
|
||||
- if ((sysfs_get_str(&a->info, NULL,
|
||||
- "reshape_position",
|
||||
- buf,
|
||||
- sizeof(buf)) >= 0) &&
|
||||
- str_is_none(buf) == true)
|
||||
+ if (sysfs_get_str(&a->info, NULL, "reshape_position", buf, sizeof(buf)) >= 0)
|
||||
+ if (str_is_none(buf) == true)
|
||||
a->last_checkpoint = a->info.component_size;
|
||||
- }
|
||||
- a->container->ss->set_array_state(a, a->curr_state <= clean);
|
||||
- a->last_checkpoint = sync_completed;
|
||||
+
|
||||
+ write_checkpoint = true;
|
||||
}
|
||||
|
||||
- if (sync_completed > a->last_checkpoint) {
|
||||
+ if (a->curr_action >= reshape && sync_completed > a->last_checkpoint) {
|
||||
+ /* Update checkpoint if neither reshape nor idle action */
|
||||
a->last_checkpoint = sync_completed;
|
||||
+
|
||||
+ write_checkpoint = true;
|
||||
+ }
|
||||
+
|
||||
+ /* Save checkpoint */
|
||||
+ if (write_checkpoint) {
|
||||
a->container->ss->set_array_state(a, a->curr_state <= clean);
|
||||
+
|
||||
+ if (a->curr_action <= reshape)
|
||||
+ a->last_checkpoint = sync_completed;
|
||||
}
|
||||
|
||||
if (sync_completed >= a->info.component_size)
|
||||
--
|
||||
2.35.3
|
||||
|
@@ -1,51 +0,0 @@
|
||||
From fdb7e802f4cf64d067c3abaafa35056e2bc1ed43 Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
|
||||
Date: Thu, 18 Jan 2024 11:30:17 +0100
|
||||
Subject: [PATCH 3/5] Super-intel: Fix first checkpoint restart
|
||||
Git-commit: fdb7e802f4cf64d067c3abaafa35056e2bc1ed43
|
||||
Patch-mainline: mdadm-4.3+
|
||||
References: jsc#PED-7542
|
||||
|
||||
When imsm based array is stopped after reaching first checkpoint and
|
||||
then assembled, first checkpoint is reported as 0.
|
||||
|
||||
This behaviour is valid only for initial checkpoint, if the array was
|
||||
stopped while performing some action.
|
||||
|
||||
Last checkpoint value is not taken from metadata but always starts
|
||||
with 0 and it's incremented when sync_completed in sysfs changes.
|
||||
|
||||
In simplification, read_and_act() is responsible for checkpoint updates
|
||||
and is executed each time sysfs checkpoint update happens. For first
|
||||
checkpoint it is executed twice and due to marking checkpoint before
|
||||
triggering any action on the array, it is impossible to read
|
||||
sync_completed from sysfs in just two iterations.
|
||||
|
||||
The workaround to this is not marking any checkpoint for first
|
||||
sysfs checkpoint after RAID assembly, to preserve checkpoint value
|
||||
stored in metadata.
|
||||
|
||||
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
|
||||
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
super-intel.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/super-intel.c b/super-intel.c
|
||||
index dbea235..e61f3f6 100644
|
||||
--- a/super-intel.c
|
||||
+++ b/super-intel.c
|
||||
@@ -8771,6 +8771,9 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
|
||||
super->updates_pending++;
|
||||
}
|
||||
|
||||
+ if (a->prev_action == idle)
|
||||
+ goto skip_mark_checkpoint;
|
||||
+
|
||||
mark_checkpoint:
|
||||
/* skip checkpointing for general migration,
|
||||
* it is controlled in mdadm
|
||||
--
|
||||
2.35.3
|
||||
|
@@ -1,65 +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 4/5] Grow: Move update_tail assign to Grow_reshape()
|
||||
Git-commit: ea2ca7ed3dbbf881ce08d80fe371f2aaf05011c3
|
||||
Patch-mainline: mdadm-4.3+
|
||||
References: jsc#PED-7542
|
||||
|
||||
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>
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
Grow.c | 13 +++++++------
|
||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/Grow.c b/Grow.c
|
||||
index f95dae8..5498e54 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.35.3
|
||||
|
@@ -1,60 +0,0 @@
|
||||
From 37eeae381a8ed07a1fabb64184fe45d95a861496 Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
|
||||
Date: Thu, 18 Jan 2024 11:30:19 +0100
|
||||
Subject: [PATCH 5/5] Add understanding output section in man
|
||||
Git-commit: 37eeae381a8ed07a1fabb64184fe45d95a861496
|
||||
Patch-mainline: mdadm-4.3+
|
||||
References: jsc#PED-7542
|
||||
|
||||
Add new section in man for explaining mdadm outputs.
|
||||
Describe checkpoint entry.
|
||||
|
||||
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
|
||||
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
mdadm.8.in | 21 ++++++++++++++++++++-
|
||||
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mdadm.8.in b/mdadm.8.in
|
||||
index 96a4a08..9ba6682 100644
|
||||
--- a/mdadm.8.in
|
||||
+++ b/mdadm.8.in
|
||||
@@ -3179,7 +3179,7 @@ environment. This can be useful for testing or for disaster
|
||||
recovery. You should be aware that interoperability may be
|
||||
compromised by setting this value.
|
||||
|
||||
-These change can also be suppressed by adding
|
||||
+These change can also be suppressed by adding
|
||||
.B mdadm.imsm.test=1
|
||||
to the kernel command line. This makes it easy to test IMSM
|
||||
code in a virtual machine that doesn't have IMSM virtual hardware.
|
||||
@@ -3454,6 +3454,25 @@ is any string. These names are supported by
|
||||
since version 3.3 provided they are enabled in
|
||||
.IR mdadm.conf .
|
||||
|
||||
+.SH UNDERSTANDING OUTPUT
|
||||
+
|
||||
+.TP
|
||||
+EXAMINE
|
||||
+
|
||||
+.TP
|
||||
+.B checkpoint
|
||||
+Checkpoint value is reported when array is performing some action including
|
||||
+resync, recovery or reshape. Checkpoints allow resuming action from certain
|
||||
+point if it was interrupted.
|
||||
+
|
||||
+Checkpoint is reported as combination of two values: current migration unit
|
||||
+and number of blocks per unit. By multiplying those values and dividing by
|
||||
+array size checkpoint progress percentage can be obtained in relation to
|
||||
+current progress reported in /proc/mdstat. Checkpoint is also related to (and
|
||||
+sometimes based on) sysfs entry sync_completed but depending on action units
|
||||
+may differ. Even if units are the same, it should not be expected that
|
||||
+checkpoint and sync_completed will be exact match nor updated simultaneously.
|
||||
+
|
||||
.SH NOTE
|
||||
.I mdadm
|
||||
was previously known as
|
||||
--
|
||||
2.35.3
|
||||
|
@@ -1,59 +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] util.c: change devnm to const in mdmon functions
|
||||
Git-commit: b0f4e8e30f38d83f7e3f53d01d72d4cb3b4d42d7
|
||||
Patch-mainline: mdadm-4.3+
|
||||
References: bsc#1225307
|
||||
|
||||
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>
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
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.35.3
|
||||
|
@@ -1,125 +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] Wait for mdmon when it is stared via systemd
|
||||
Git-commit: aa1cc5815d2b14a8b47add18cfaa8264e19c10ce
|
||||
Patch-mainline: mdadm-4.3+
|
||||
References: bsc#1225307
|
||||
|
||||
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>
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
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.35.3
|
||||
|
@@ -0,0 +1,56 @@
|
||||
From b5f5415636cebafc1a10cc5ee1887adba8fce74d Mon Sep 17 00:00:00 2001
|
||||
From: Coly Li <colyli@suse.de>
|
||||
Date: Wed, 22 Jan 2025 23:18:59 +0800
|
||||
Subject: [PATCH] mdopen: add sbin path to env PATH when call system("modprobe
|
||||
md_mod")
|
||||
|
||||
During the boot process if mdadm is called in udev context, sbin paths
|
||||
like /sbin, /usr/sbin, /usr/local/sbin normally not defined in PATH env
|
||||
variable, calling system("modprobe md_mod") in create_named_array() may
|
||||
fail with 'sh: modprobe: command not found' error message.
|
||||
|
||||
We don't want to move modprobe binary into udev private directory, so
|
||||
setting the PATH env is a more proper method to avoid the above issue.
|
||||
|
||||
This patch sets PATH env variable with "/sbin:/usr/sbin:/usr/local/sbin"
|
||||
before calling system("modprobe md_mod"). The change only takes effect
|
||||
within the udev worker context, not seen by global udev environment.
|
||||
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>
|
||||
---
|
||||
mdopen.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/mdopen.c b/mdopen.c
|
||||
index 26f0c71..57252b6 100644
|
||||
--- a/mdopen.c
|
||||
+++ b/mdopen.c
|
||||
@@ -39,6 +39,24 @@ int create_named_array(char *devnm)
|
||||
|
||||
fd = open(new_array_file, O_WRONLY);
|
||||
if (fd < 0 && errno == ENOENT) {
|
||||
+ char buf[PATH_MAX] = {0};
|
||||
+ char *env_ptr;
|
||||
+
|
||||
+ env_ptr = getenv("PATH");
|
||||
+ /*
|
||||
+ * When called by udev worker context, path of modprobe
|
||||
+ * might not be in env PATH. Set sbin paths into PATH
|
||||
+ * env to avoid potential failure when run modprobe here.
|
||||
+ */
|
||||
+ if (env_ptr)
|
||||
+ snprintf(buf, PATH_MAX - 1, "%s:%s", env_ptr,
|
||||
+ "/sbin:/usr/sbin:/usr/local/sbin");
|
||||
+ else
|
||||
+ snprintf(buf, PATH_MAX - 1, "%s",
|
||||
+ "/sbin:/usr/sbin:/usr/local/sbin");
|
||||
+
|
||||
+ setenv("PATH", buf, 1);
|
||||
+
|
||||
if (system("modprobe md_mod") == 0)
|
||||
fd = open(new_array_file, O_WRONLY);
|
||||
}
|
||||
--
|
||||
2.48.1
|
||||
|
113
1000-Revert-mdmonitor-Abandon-custom-configuration-files.patch
Normal file
113
1000-Revert-mdmonitor-Abandon-custom-configuration-files.patch
Normal file
@@ -0,0 +1,113 @@
|
||||
From 58a2ce726968dcc60aa4d8c380e4f093afd33c58 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Wilck <mwilck@suse.com>
|
||||
Date: Thu, 27 Feb 2025 23:17:42 +0100
|
||||
Subject: [PATCH] Revert "mdmonitor: Abandon custom configuration files"
|
||||
|
||||
This reverts commit a7a5e676a7eb2ac97acd31b13f75515e9573f891.
|
||||
For the time being, we want to stick with /etc/sysconfig/mdadm
|
||||
---
|
||||
Makefile | 1 +
|
||||
systemd/SUSE-mdadm_env.sh | 48 +++++++++++++++++++++++++++++++++++++++
|
||||
systemd/mdmonitor.service | 22 ++++--------------
|
||||
3 files changed, 53 insertions(+), 18 deletions(-)
|
||||
create mode 100644 systemd/SUSE-mdadm_env.sh
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index bcd092d..24367b0 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -341,6 +341,7 @@ install-systemd: systemd/mdmon@.service
|
||||
$(INSTALL) -D -m 755 .install.tmp.3 $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \
|
||||
rm -f .install.tmp.3; \
|
||||
done
|
||||
+ if [ -f /etc/SuSE-release -o -n "$(SUSE)" ] ;then $(INSTALL) -D -m 755 systemd/SUSE-mdadm_env.sh $(DESTDIR)$(LIB_DIR)/mdadm_env.sh ;fi
|
||||
|
||||
install-bin: mdadm mdmon
|
||||
$(INSTALL) -D $(STRIP) -m 755 mdadm $(DESTDIR)$(BINDIR)/mdadm
|
||||
diff --git a/systemd/SUSE-mdadm_env.sh b/systemd/SUSE-mdadm_env.sh
|
||||
new file mode 100644
|
||||
index 0000000..c13b48a
|
||||
--- /dev/null
|
||||
+++ b/systemd/SUSE-mdadm_env.sh
|
||||
@@ -0,0 +1,48 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+# extract configuration from /etc/sysconfig/mdadm and write
|
||||
+# environment to /run/sysconfig/mdadm to be used by
|
||||
+# systemd unit files.
|
||||
+
|
||||
+MDADM_SCAN="yes"
|
||||
+
|
||||
+# Following adapted from /etc/init.d/mdadmd on openSUSE
|
||||
+
|
||||
+mdadmd_CONFIG=/etc/sysconfig/mdadm
|
||||
+if test -r $mdadmd_CONFIG; then
|
||||
+ . $mdadmd_CONFIG
|
||||
+fi
|
||||
+
|
||||
+if [ x$MDADM_DELAY != x"" ]; then
|
||||
+ MDADM_DELAY="-d "$MDADM_DELAY;
|
||||
+fi
|
||||
+
|
||||
+if [ x$MDADM_MAIL != x"" ]; then
|
||||
+ MDADM_MAIL="-m \"$MDADM_MAIL\""
|
||||
+fi
|
||||
+
|
||||
+if [ x$MDADM_PROGRAM != x"" ]; then
|
||||
+ MDADM_PROGRAM="-p \"$MDADM_PROGRAM\""
|
||||
+fi
|
||||
+
|
||||
+if [ x$MDADM_SCAN = x"yes" ]; then
|
||||
+ MDADM_SCAN="--scan"
|
||||
+else
|
||||
+ MDADM_SCAN=""
|
||||
+fi
|
||||
+
|
||||
+if [ x$MDADM_SEND_MAIL_ON_START = x"yes" ]; then
|
||||
+ MDADM_SEND_MAIL="-t"
|
||||
+else
|
||||
+ MDADM_SEND_MAIL=""
|
||||
+fi
|
||||
+
|
||||
+if [ x$MDADM_CONFIG != x"" ]; then
|
||||
+ MDADM_CONFIG="-c \"$MDADM_CONFIG\""
|
||||
+fi
|
||||
+
|
||||
+mkdir -p /run/sysconfig
|
||||
+echo "MDADM_MONITOR_ARGS=$MDADM_RAIDDEVICES $MDADM_DELAY $MDADM_MAIL $MDADM_PROGRAM $MDADM_SCAN $MDADM_SEND_MAIL $MDADM_CONFIG" > /run/sysconfig/mdadm
|
||||
+if [ -n "$MDADM_CHECK_DURATION" ]; then
|
||||
+ echo "MDADM_CHECK_DURATION=$MDADM_CHECK_DURATION" >> /run/sysconfig/mdadm
|
||||
+fi
|
||||
diff --git a/systemd/mdmonitor.service b/systemd/mdmonitor.service
|
||||
index 95046bc..9c36478 100644
|
||||
--- a/systemd/mdmonitor.service
|
||||
+++ b/systemd/mdmonitor.service
|
||||
@@ -11,21 +11,7 @@ DefaultDependencies=no
|
||||
Documentation=man:mdadm(8)
|
||||
|
||||
[Service]
|
||||
-# For Maintainers:
|
||||
-# We need to ensure that the mdmonitor configuration aligns with the guidelines provided
|
||||
-# in the man page for users.
|
||||
-# /etc/sysconfig/mdadm, /etc/sysconfig/mdmonitor, or any other similar configuration file should
|
||||
-# not be supported because non upstream components are not described in man pages.
|
||||
-
|
||||
-# Parameters designed to be customized by user, should be settable via mdadm.conf:
|
||||
-# - MONITORDELAY (do not set --delay in service)
|
||||
-# - MAILADDR (do not set --mail in service)
|
||||
-# - MAILFROM (not settable from cmdline)
|
||||
-# - PROGRAM (do not set --program or --alert in service)
|
||||
-#
|
||||
-# Following parameters can be customized in service:
|
||||
-# - --syslog (configure syslog logging)
|
||||
-# - --fork (Type=forking must be added, not recommended and not needed with systemd)
|
||||
-# - --pid-file (allowed only when --fork selected)
|
||||
-
|
||||
-ExecStart=BINDIR/mdadm --monitor --scan
|
||||
+Environment= MDADM_MONITOR_ARGS=--scan
|
||||
+EnvironmentFile=-/run/sysconfig/mdadm
|
||||
+ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh
|
||||
+ExecStart=BINDIR/mdadm --monitor $MDADM_MONITOR_ARGS
|
||||
--
|
||||
2.48.1
|
||||
|
@@ -1,13 +1,18 @@
|
||||
---
|
||||
Detail.c | 1 +
|
||||
md_p.h | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
From 37339bd211623574efd2f6f5e5133a3247e3bbde Mon Sep 17 00:00:00 2001
|
||||
From: Martin Wilck <mwilck@suse.com>
|
||||
Date: Thu, 27 Feb 2025 23:24:16 +0100
|
||||
Subject: [PATCH 1001/1005] mdadm -D: display timeout status
|
||||
|
||||
Index: mdadm-4.0/Detail.c
|
||||
===================================================================
|
||||
--- mdadm-4.0.orig/Detail.c
|
||||
+++ mdadm-4.0/Detail.c
|
||||
@@ -693,6 +693,8 @@ This is pretty boring
|
||||
---
|
||||
Detail.c | 2 ++
|
||||
md_p.h | 1 +
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/Detail.c b/Detail.c
|
||||
index 5819ced..1e2e4c0 100644
|
||||
--- a/Detail.c
|
||||
+++ b/Detail.c
|
||||
@@ -745,6 +745,8 @@ int Detail(char *dev, struct context *c)
|
||||
disk.raid_disk >= 0)
|
||||
failed++;
|
||||
}
|
||||
@@ -16,10 +21,10 @@ Index: mdadm-4.0/Detail.c
|
||||
if (disk.state & (1 << MD_DISK_ACTIVE))
|
||||
printf(" active");
|
||||
if (disk.state & (1 << MD_DISK_SYNC)) {
|
||||
Index: mdadm-4.0/md_p.h
|
||||
===================================================================
|
||||
--- mdadm-4.0.orig/md_p.h
|
||||
+++ mdadm-4.0/md_p.h
|
||||
diff --git a/md_p.h b/md_p.h
|
||||
index 358a28c..9c66dc6 100644
|
||||
--- a/md_p.h
|
||||
+++ b/md_p.h
|
||||
@@ -90,6 +90,7 @@
|
||||
* dire need
|
||||
*/
|
||||
@@ -28,3 +33,6 @@ Index: mdadm-4.0/md_p.h
|
||||
|
||||
#define MD_DISK_REPLACEMENT 17
|
||||
#define MD_DISK_JOURNAL 18 /* disk is used as the write journal in RAID-5/6 */
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
From e9d2cca0f83075a946fef81012cf60bb73fee73b Mon Sep 17 00:00:00 2001
|
||||
From: Ali Abdallah <ali.abdallah@suse.com>
|
||||
Subject: OnCalendar format fix of mdcheck_start.timer
|
||||
Patch-mainline: in-house patch at this moment, will post to upstream in future
|
||||
References: bsc#1173137
|
||||
Date: Thu, 27 Feb 2025 23:24:25 +0100
|
||||
Subject: [PATCH 1002/1005] OnCalendar format fix of mdcheck_start.timer
|
||||
|
||||
This patch includes the fix of the OnCalendar format, changing the format of
|
||||
mdcheck_start.timer [Timer] section,
|
||||
@@ -10,10 +10,14 @@ to OnCalendar=Sun *-*-* 1:00:00
|
||||
|
||||
Signed-off-by: Ali Abdallah <ali.abdallah@suse.com>
|
||||
Acked-by: Coly Li <colyli@suse.de>
|
||||
Index: mdadm-4.1/systemd/mdcheck_start.timer
|
||||
===================================================================
|
||||
--- mdadm-4.1.orig/systemd/mdcheck_start.timer
|
||||
+++ mdadm-4.1/systemd/mdcheck_start.timer
|
||||
---
|
||||
systemd/mdcheck_start.timer | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/systemd/mdcheck_start.timer b/systemd/mdcheck_start.timer
|
||||
index 9e7e02a..ba15ef5 100644
|
||||
--- a/systemd/mdcheck_start.timer
|
||||
+++ b/systemd/mdcheck_start.timer
|
||||
@@ -9,7 +9,7 @@
|
||||
Description=MD array scrubbing
|
||||
|
||||
@@ -23,3 +27,6 @@ Index: mdadm-4.1/systemd/mdcheck_start.timer
|
||||
|
||||
[Install]
|
||||
WantedBy= mdmonitor.service
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -1,9 +1,7 @@
|
||||
From 2361620a9d78a4e26ec438b5cc21fe796d411497 Mon Sep 17 00:00:00 2001
|
||||
From 1b1936b64511186ef0ea78b8b147825302f8ef56 Mon Sep 17 00:00:00 2001
|
||||
From: Coly Li <colyli@suse.de>
|
||||
Date: Mon, 31 Aug 2020 00:02:10 +0800
|
||||
Subject: [PATCH] mdadm: treat the Dell softraid array as local array
|
||||
Patch-mainline: N/A, in-house usage only as a workaround to Dell's softraid bug
|
||||
References: bsc#1175004
|
||||
Subject: [PATCH 1003/1005] mdadm: treat the Dell softraid array as local array
|
||||
|
||||
Dell softraid FW uses homehost in md raid superblock to store
|
||||
its virtual disk name e.g. "VirtualDisk01". The improper usage
|
||||
@@ -24,17 +22,17 @@ Signed-off-by: Coly Li <colyli@suse.de>
|
||||
1 file changed, 18 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/super1.c b/super1.c
|
||||
index 7664883..d15067a 100644
|
||||
index fe3c4c6..2ad373d 100644
|
||||
--- a/super1.c
|
||||
+++ b/super1.c
|
||||
@@ -954,8 +954,25 @@ static int examine_badblocks_super1(struct supertype *st, int fd, char *devname)
|
||||
@@ -958,8 +958,25 @@ static int examine_badblocks_super1(struct supertype *st, int fd, char *devname)
|
||||
static int match_home1(struct supertype *st, char *homehost)
|
||||
{
|
||||
struct mdp_superblock_1 *sb = st->sb;
|
||||
- int l = homehost ? strlen(homehost) : 0;
|
||||
+ char *dell_softraid_header = "VirtualDisk";
|
||||
+ int l = strlen(dell_softraid_header);
|
||||
+
|
||||
|
||||
+ /*
|
||||
+ * Dell softraid FW uses homehost in md raid superblock to store
|
||||
+ * its virtual disk name e.g. "VirtualDisk01". The improper usage
|
||||
@@ -48,12 +46,12 @@ index 7664883..d15067a 100644
|
||||
+ */
|
||||
+ if (strncmp(sb->set_name, dell_softraid_header, l) == 0)
|
||||
+ return 1;
|
||||
|
||||
+
|
||||
+ /* Normal cases handleing */
|
||||
+ l = homehost ? strlen(homehost) : 0;
|
||||
return (l > 0 && l < 32 && sb->set_name[l] == ':' &&
|
||||
strncmp(sb->set_name, homehost, l) == 0);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
2.48.1
|
||||
|
||||
|
@@ -1,9 +1,7 @@
|
||||
From 6e79d4bd229e5db4e435917daf4c57cd79db9265 Mon Sep 17 00:00:00 2001
|
||||
From 8a5cf693f728f55456b18d79b2313adc4ea4bc43 Mon Sep 17 00:00:00 2001
|
||||
From: colyli <colyli@suse.coly>
|
||||
Date: Wed, 17 Oct 2018 11:08:39 +0800
|
||||
Subject: [PATCH] Call mdadm_env.sh from /usr/libexec/mdadm
|
||||
Patch-mainline: N/A, SUSE only patch
|
||||
References: bsc#1111960, bsc#1202090
|
||||
Subject: [PATCH 1004/1005] Call mdadm_env.sh from /usr/libexec/mdadm
|
||||
|
||||
Current Makefile installs mdadm_env.sh to /usr/libexec/mdadm but the
|
||||
systemd service files call it from /usr/lib/mdadm. This patch changes
|
||||
@@ -12,13 +10,16 @@ make things working.
|
||||
|
||||
Signed-off-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
systemd/mdcheck_continue.service | 2 ++
|
||||
systemd/mdcheck_start.service | 2 ++
|
||||
systemd/mdmonitor-oneshot.service | 2 +-
|
||||
systemd/mdmonitor.service | 2 +-
|
||||
4 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: mdadm-4.3/systemd/mdcheck_continue.service
|
||||
===================================================================
|
||||
--- mdadm-4.3.orig/systemd/mdcheck_continue.service
|
||||
+++ mdadm-4.3/systemd/mdcheck_continue.service
|
||||
diff --git a/systemd/mdcheck_continue.service b/systemd/mdcheck_continue.service
|
||||
index 70892a1..454b92f 100644
|
||||
--- a/systemd/mdcheck_continue.service
|
||||
+++ b/systemd/mdcheck_continue.service
|
||||
@@ -13,4 +13,6 @@ Documentation=man:mdadm(8)
|
||||
[Service]
|
||||
Type=oneshot
|
||||
@@ -26,10 +27,10 @@ Index: mdadm-4.3/systemd/mdcheck_continue.service
|
||||
+EnvironmentFile=-/run/sysconfig/mdadm
|
||||
+ExecStartPre=-/usr/libexec/mdadm/mdadm_env.sh
|
||||
ExecStart=/usr/share/mdadm/mdcheck --continue --duration ${MDADM_CHECK_DURATION}
|
||||
Index: mdadm-4.3/systemd/mdcheck_start.service
|
||||
===================================================================
|
||||
--- mdadm-4.3.orig/systemd/mdcheck_start.service
|
||||
+++ mdadm-4.3/systemd/mdcheck_start.service
|
||||
diff --git a/systemd/mdcheck_start.service b/systemd/mdcheck_start.service
|
||||
index fc4fc43..a1077f0 100644
|
||||
--- a/systemd/mdcheck_start.service
|
||||
+++ b/systemd/mdcheck_start.service
|
||||
@@ -13,4 +13,6 @@ Documentation=man:mdadm(8)
|
||||
[Service]
|
||||
Type=oneshot
|
||||
@@ -37,10 +38,10 @@ Index: mdadm-4.3/systemd/mdcheck_start.service
|
||||
+EnvironmentFile=-/run/sysconfig/mdadm
|
||||
+ExecStartPre=-/usr/libexec/mdadm/mdadm_env.sh
|
||||
ExecStart=/usr/share/mdadm/mdcheck --duration ${MDADM_CHECK_DURATION}
|
||||
Index: mdadm-4.3/systemd/mdmonitor-oneshot.service
|
||||
===================================================================
|
||||
--- mdadm-4.3.orig/systemd/mdmonitor-oneshot.service
|
||||
+++ mdadm-4.3/systemd/mdmonitor-oneshot.service
|
||||
diff --git a/systemd/mdmonitor-oneshot.service b/systemd/mdmonitor-oneshot.service
|
||||
index ba86b44..3b9d073 100644
|
||||
--- a/systemd/mdmonitor-oneshot.service
|
||||
+++ b/systemd/mdmonitor-oneshot.service
|
||||
@@ -12,5 +12,5 @@ Documentation=man:mdadm(8)
|
||||
[Service]
|
||||
Environment=MDADM_MONITOR_ARGS=--scan
|
||||
@@ -48,10 +49,10 @@ Index: mdadm-4.3/systemd/mdmonitor-oneshot.service
|
||||
-ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh
|
||||
+ExecStartPre=-/usr/libexec/mdadm/mdadm_env.sh
|
||||
ExecStart=BINDIR/mdadm --monitor --oneshot $MDADM_MONITOR_ARGS
|
||||
Index: mdadm-4.3/systemd/mdmonitor.service
|
||||
===================================================================
|
||||
--- mdadm-4.3.orig/systemd/mdmonitor.service
|
||||
+++ mdadm-4.3/systemd/mdmonitor.service
|
||||
diff --git a/systemd/mdmonitor.service b/systemd/mdmonitor.service
|
||||
index 9c36478..71cf4fe 100644
|
||||
--- a/systemd/mdmonitor.service
|
||||
+++ b/systemd/mdmonitor.service
|
||||
@@ -13,5 +13,5 @@ Documentation=man:mdadm(8)
|
||||
[Service]
|
||||
Environment= MDADM_MONITOR_ARGS=--scan
|
||||
@@ -59,3 +60,6 @@ Index: mdadm-4.3/systemd/mdmonitor.service
|
||||
-ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh
|
||||
+ExecStartPre=-/usr/libexec/mdadm/mdadm_env.sh
|
||||
ExecStart=BINDIR/mdadm --monitor $MDADM_MONITOR_ARGS
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -1,9 +1,7 @@
|
||||
From 449c8b62164880ab132ad6eec86a8d53f793af69 Mon Sep 17 00:00:00 2001
|
||||
From b30b6e1c3ae6c3258ec7f6862d361842e4ec489f Mon Sep 17 00:00:00 2001
|
||||
From: Hannes Reinecke <hare@suse.de>
|
||||
Date: Tue, 19 Jul 2022 13:18:23 +0800
|
||||
Subject: [PATCH 19/23] mdadm: enable Intel Alderlake RSTe configuration
|
||||
Patch-mainline: N/A, SUSE only patch
|
||||
References: bsc#1201297
|
||||
Subject: [PATCH 1005/1006] mdadm: enable Intel Alderlake RSTe configuration
|
||||
|
||||
Alderlake has a slightly different RST configuration; the UEFI
|
||||
variable is name 'RstVmdV', and the AHCI controller shows up as
|
||||
@@ -13,41 +11,23 @@ PCI class (and not the RAID class as RSTe would normally do).
|
||||
Signed-off-by: Hannes Reinecke <hare@suse.de>
|
||||
Acked-by: Coly Li <colyli@suse.de>
|
||||
---
|
||||
platform-intel.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
platform-intel.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: mdadm-4.2/platform-intel.c
|
||||
===================================================================
|
||||
--- mdadm-4.2.orig/platform-intel.c
|
||||
+++ mdadm-4.2/platform-intel.c
|
||||
@@ -512,6 +512,7 @@ static const struct imsm_orom *find_imsm
|
||||
#define AHCI_PROP "RstSataV"
|
||||
#define AHCI_SSATA_PROP "RstsSatV"
|
||||
#define AHCI_TSATA_PROP "RsttSatV"
|
||||
+#define AHCI_RST_PROP "RstVmdV"
|
||||
#define VROC_VMD_PROP "RstUefiV"
|
||||
diff --git a/platform-intel.c b/platform-intel.c
|
||||
index 95bc492..9a6f586 100644
|
||||
--- a/platform-intel.c
|
||||
+++ b/platform-intel.c
|
||||
@@ -656,6 +656,7 @@ static const struct imsm_orom *find_imsm_hba_orom(struct sys_dev *hba)
|
||||
#define RST_VMD_PROP "RstVmdV"
|
||||
|
||||
@@ -519,6 +520,7 @@ static const struct imsm_orom *find_imsm
|
||||
EFI_GUID(0x193dfefa, 0xa445, 0x4302, 0x99, 0xd8, 0xef, 0x3a, 0xad, 0x1a, 0x04, 0xc6)
|
||||
|
||||
#define PCI_CLASS_RAID_CNTRL 0x010400
|
||||
+#define PCI_CLASS_SATA_HBA 0x010601
|
||||
|
||||
static int read_efi_var(void *buffer, ssize_t buf_size,
|
||||
const char *variable_name, struct efi_guid guid)
|
||||
@@ -605,7 +607,8 @@ const struct imsm_orom *find_imsm_efi(st
|
||||
struct imsm_orom orom;
|
||||
struct orom_entry *ret;
|
||||
static const char * const sata_efivars[] = {AHCI_PROP, AHCI_SSATA_PROP,
|
||||
- AHCI_TSATA_PROP};
|
||||
+ AHCI_TSATA_PROP,
|
||||
+ AHCI_RST_PROP};
|
||||
static const char * const vmd_efivars[] = {VROC_VMD_PROP, RST_VMD_PROP};
|
||||
unsigned long i;
|
||||
|
||||
@@ -624,7 +627,8 @@ const struct imsm_orom *find_imsm_efi(st
|
||||
|
||||
/* GUID length in Bytes */
|
||||
#define GUID_LENGTH 16
|
||||
@@ -1049,7 +1050,8 @@ const struct imsm_orom *find_imsm_efi(struct sys_dev *hba)
|
||||
break;
|
||||
return NULL;
|
||||
case SYS_DEV_SATA:
|
||||
- if (hba->class != PCI_CLASS_RAID_CNTRL)
|
||||
@@ -55,4 +35,7 @@ Index: mdadm-4.2/platform-intel.c
|
||||
+ hba->class != PCI_CLASS_SATA_HBA)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(sata_efivars); i++) {
|
||||
if (find_imsm_efi_orom(&orom, hba->type))
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
74
1006-imsm-Fix-RAID0-to-RAID10-migration.patch
Normal file
74
1006-imsm-Fix-RAID0-to-RAID10-migration.patch
Normal file
@@ -0,0 +1,74 @@
|
||||
From 127e38b59cbdf717d1569bcdc75b8d823d8485f3 Mon Sep 17 00:00:00 2001
|
||||
From: Blazej Kucman <blazej.kucman@intel.com>
|
||||
Date: Mon, 31 Mar 2025 12:46:52 +0200
|
||||
Subject: [PATCH] imsm: Fix RAID0 to RAID10 migration
|
||||
|
||||
Support for RAID10 with +4 disks in IMSM introduced an inconsistency
|
||||
between the VROC UEFI driver and Linux IMSM. VROC UEFI does not
|
||||
support RAID10 with +4 disks, therefore appropriate protections were
|
||||
added to the mdadm IMSM code that results in skipping processing of
|
||||
such RAID in the UEFI phase. Unfortunately the case of migration
|
||||
RAID0 2 disks to RAID10 4 disks was omitted, this case requires
|
||||
maintaining compatibility with the VROC UEFI driver because it is
|
||||
supported.
|
||||
|
||||
For RAID10 +4 disk the MPB_ATTRIB_RAID10_EXT attribute is set in the
|
||||
metadata, thanks to which the UEFI driver does not process such RAID.
|
||||
In the series adding support, a new metadata raid level value
|
||||
IMSM_T_RAID10 was also introduced. It is not recognized by VROC UEFI.
|
||||
|
||||
The issue is caused by the fact that in the case of the mentioned
|
||||
migration, IMSM_T_RAID10 is entered into the metadata but attribute
|
||||
MPB_ATTRIB_RAID10_EXT is not entered, which causes an attempt to
|
||||
process such RAID in the UEFI phase. This situation results in
|
||||
the platform hang during booting in UEFI phase, this also results in
|
||||
data loss after failed and interrupted RAID processing in VROC UEFI.
|
||||
|
||||
The above situation is result of the update_imsm_raid_level()
|
||||
function, for the mentioned migration function is executed on a map
|
||||
with a not yet updated number of disks.
|
||||
|
||||
The fix is to explicitly handle migration in the function mentioned
|
||||
above to maintain compatibility with VROC UEFI driver.
|
||||
|
||||
Steps to reproduce:
|
||||
mdadm -C /dev/md/imsm0 -e imsm -n 2 /dev/nvme[1,2]n1 -R
|
||||
mdadm -C /dev/md/vol -l 0 -n 2 /dev/nvme[1,2]n1 --assume-clean -R
|
||||
mdadm -a /dev/md127 /dev/nvme3n1
|
||||
mdadm -a /dev/md127 /dev/nvme4n1
|
||||
mdadm -G /dev/md126 -l 10
|
||||
reboot
|
||||
|
||||
Fixes: 27550b13297a ("imsm: add support for literal RAID 10")
|
||||
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
|
||||
---
|
||||
super-intel.c | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/super-intel.c b/super-intel.c
|
||||
index 4988eef1..b7b030a2 100644
|
||||
--- a/super-intel.c
|
||||
+++ b/super-intel.c
|
||||
@@ -1327,6 +1327,19 @@ static void update_imsm_raid_level(struct imsm_map *map, int new_level)
|
||||
return;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * RAID0 to RAID10 migration.
|
||||
+ * Due to the compatibility with VROC UEFI must be maintained, this case must be handled
|
||||
+ * separately, because the map does not have an updated number of disks.
|
||||
+ */
|
||||
+ if (map->raid_level == IMSM_T_RAID0) {
|
||||
+ if (map->num_members == 2)
|
||||
+ map->raid_level = IMSM_T_RAID1;
|
||||
+ else
|
||||
+ map->raid_level = IMSM_T_RAID10;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (map->num_members == 4) {
|
||||
if (map->raid_level == IMSM_T_RAID10 || map->raid_level == IMSM_T_RAID1)
|
||||
return;
|
||||
--
|
||||
2.35.3
|
||||
|
@@ -0,0 +1,42 @@
|
||||
From 48319768f534e4655ef66176a95d2355a431d735 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Wilck <mwilck@suse.com>
|
||||
Date: Wed, 30 Apr 2025 21:18:36 +0200
|
||||
Subject: [PATCH 1007/1008] mdadm: allow any valid minor number in md device
|
||||
name
|
||||
|
||||
Since 25aa732 ("mdadm: numbered names verification"), it is not possible
|
||||
any more to create arrays /dev/md${N} with N >= 127. The limit has later
|
||||
been increased to 1024, which is also artificial. The error message printed
|
||||
by mdadm is misleading, as the problem is not POSIX compatibility here.
|
||||
|
||||
# mdadm -C -v /dev/md9999 --name=foo -l1 -n2 /dev/loop0 /dev/loop1
|
||||
mdadm: Value "/dev/md9999" cannot be set as devname. Reason: Not POSIX compatible.
|
||||
|
||||
Given that mdadm creates an array with minor number ${N} if the argument is
|
||||
/dev/md${N}, the natural limit for the number is the highest minor number
|
||||
available, which is (1 << MINORBITS) with MINORBITS=20 on Linux.
|
||||
|
||||
Fixes: 25aa732 ("mdadm: numbered names verification")
|
||||
Fixes: f786072 ("mdadm: Increase number limit in md device name to 1024.")
|
||||
Signed-off-by: Martin Wilck <mwilck@suse.com>
|
||||
---
|
||||
util.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util.c b/util.c
|
||||
index 9fe2d22..0f77521 100644
|
||||
--- a/util.c
|
||||
+++ b/util.c
|
||||
@@ -972,7 +972,8 @@ static bool is_devname_numbered(const char *devname, const char *pref, const int
|
||||
if (parse_num(&val, devname + pref_len) != 0)
|
||||
return false;
|
||||
|
||||
- if (val > 1024)
|
||||
+ /* Allow any number that represents a valid minor number */
|
||||
+ if (val >= (1 << 20))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
--
|
||||
2.49.0
|
||||
|
@@ -0,0 +1,47 @@
|
||||
From 730586b291b9aecdbf03704ac2cb4e38082f2ce9 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Wilck <mwilck@suse.com>
|
||||
Date: Wed, 7 May 2025 17:49:05 +0200
|
||||
Subject: [PATCH] mdmonitor: use MAILFROM to set sendmail envelope sender
|
||||
address
|
||||
|
||||
Modern mail relays may reject emails with unknown envelope sender
|
||||
address.
|
||||
|
||||
Use the MAILFROM address also as envelope sender address to work
|
||||
around this issue.
|
||||
|
||||
Signed-off-by: Martin Wilck <mwilck@suse.com>
|
||||
---
|
||||
mdmonitor.c | 13 +++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mdmonitor.c b/mdmonitor.c
|
||||
index d51617c..ea35d98 100644
|
||||
--- a/mdmonitor.c
|
||||
+++ b/mdmonitor.c
|
||||
@@ -639,11 +639,20 @@ static void execute_alert_cmd(const struct event_data *data)
|
||||
*/
|
||||
static void send_event_email(const struct event_data *data)
|
||||
{
|
||||
- FILE *mp, *mdstat;
|
||||
+ FILE *mp = NULL, *mdstat;
|
||||
char buf[BUFSIZ];
|
||||
int n;
|
||||
|
||||
- mp = popen(Sendmail, "w");
|
||||
+ if (info.mailfrom) {
|
||||
+ char cmd[1024];
|
||||
+ int rc = snprintf(cmd, sizeof(cmd), "%s -f%s",
|
||||
+ Sendmail, info.mailfrom);
|
||||
+
|
||||
+ if (rc >= 0 && (unsigned int)rc < sizeof(cmd))
|
||||
+ mp = popen(cmd, "w");
|
||||
+ }
|
||||
+ if (mp == NULL)
|
||||
+ mp = popen(Sendmail, "w");
|
||||
if (!mp) {
|
||||
pr_err("Cannot open pipe stream for sendmail.\n");
|
||||
return;
|
||||
--
|
||||
2.49.0
|
||||
|
16
_service
Normal file
16
_service
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<services>
|
||||
<service name="obs_scm" mode="manual">
|
||||
<param name="scm">git</param>
|
||||
<param name="url">https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git</param>
|
||||
<param name="filename">mdadm</param>
|
||||
<param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@+g%h</param>
|
||||
<param name="revision">mdadm-4.4</param>
|
||||
<param name="match-tag">mdadm-[0-9].[0-9]*</param>
|
||||
<param name="versionrewrite-pattern">mdadm-([0-9]\.[0-9]+)((\+0\+g[0-9a-f]+)|(\+[1-9][0-9]*\+g[0-9a-f]+))</param>
|
||||
<param name="versionrewrite-replacement">\1\4</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
<service name="set_version" mode="manual"/>
|
||||
<service mode="buildtime" name="tar"/>
|
||||
</services>
|
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7ed64ea459e464420d3489d3f1875d3083f72e281ad4cd2f9c12a9ea44a5b606
|
||||
size 467024
|
BIN
mdadm-4.4.obscpio
(Stored with Git LFS)
Normal file
BIN
mdadm-4.4.obscpio
(Stored with Git LFS)
Normal file
Binary file not shown.
101
mdadm.changes
101
mdadm.changes
@@ -1,3 +1,104 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 21 10:53:04 UTC 2025 - Jan Engelhardt <jengelh@inai.de>
|
||||
|
||||
- Stop emitting %release into program binaries [boo#1246806]
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 27 13:28:42 UTC 2025 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- monitor: Add MAILFROM address to email envelope to avoid smtp auth
|
||||
errors (bsc#1241474)
|
||||
* add 1008-mdmonitor-use-MAILFROM-to-set-sendmail-envelope-send.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 7 15:59:57 UTC 2025 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- Allow any valid minor name in md device name (bsc#1240789)
|
||||
* add 1007-mdadm-allow-any-valid-minor-number-in-md-device-name.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 6 15:54:25 UTC 2025 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- Add dependency on suse-module-tools for SLE15 (bsc#1242696)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 10 10:54:06 UTC 2025 - Ales Novak <alnovak@suse.com>
|
||||
|
||||
- IMSM RAID0 2 disks to RAID10 4 disks migration fix
|
||||
add 1006-imsm-Fix-RAID0-to-RAID10-migration.patch (bsc#1241001)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 4 13:42:52 UTC 2025 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- cleanup 1005-mdadm-enable-Intel-Alderlake-RSTe-configuration.patch
|
||||
(remove a redundant macro definition)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 28 22:10:00 UTC 2025 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- mdopen: add sbin path to env PATH when call system("modprobe md_mod")
|
||||
(bsc#1233265)
|
||||
add 0010-mdopen-add-sbin-path-to-env-PATH-when-call-system-mo.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 27 21:51:04 UTC 2025 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- Update to version 4.4 (jsc#PED-10220)
|
||||
Features:
|
||||
* Remove custom bitmap file support from Yu Kuai.
|
||||
* Custom device policies implementation from Mariusz Tkaczyk.
|
||||
* Self encrypted drives (**SED**) support for IMSM metadata from Blazej Kucman.
|
||||
* Support more than 4 disks for **IMSM** RAID10 from Mateusz Kusiak.
|
||||
* Read **IMSM** license information from ACPI tables from Blazej Kucman.
|
||||
* Support devnode in **--Incremental --remove** from Mariusz Tkaczyk.
|
||||
* Printing **IMSM** license type in **--detail-platform** from Blazej Kucman.
|
||||
* README.md from Mariusz Tkaczyk and Anna Sztukowska.
|
||||
Fixes:
|
||||
* Tests improvements from Xiao Ni and Kinga Stefaniuk.
|
||||
* Mdmon's Checkpointing improvements from Mateusz Kusiak.
|
||||
* Pass mdadm environment flags to systemd-env to enable tests from Mateusz Kusiak.
|
||||
* Superblock 1.0 uuid printing fixes from Mariusz Tkaczyk.
|
||||
* Find VMD bus manually if link is not available from Mariusz Tkaczyk.
|
||||
* Unconditional devices count printing in --detail from Anna Sztukowska.
|
||||
* Improve SIGTERM handling during reshape, from Mateusz Kusiak.
|
||||
* **Monitor.c** renamed to **Mdmonitor.c** from Kinga Stefaniuk.
|
||||
* Mdmonitor service documentation update from Mariusz Tkaczyk.
|
||||
* Rework around writing to sysfs files from Mariusz Tkaczyk.
|
||||
* Drop of HOT_REMOVE_DISK ioctl in Manage in favour of sysfs from Mariusz Tkaczyk.
|
||||
* Delegate disk removal to managemon from Mariusz Tkaczyk.
|
||||
* Some clean-ups of legacy code and functionalities like **--auto=md** from Mariusz Tkaczyk.
|
||||
* Manual clean-up, references to old kernels removed from Mariusz Tkaczyk.
|
||||
* Various static code analysis fixes.
|
||||
|
||||
- Add 1000-Revert-mdmonitor-Abandon-custom-configuration-files.patch
|
||||
(reverts upstream change to ignore /etc/sysconfig/mdadm)
|
||||
|
||||
- Drop obsolete patches (included upstream):
|
||||
* Del 0001-Remove-hardcoded-checkpoint-interval-checking.patch
|
||||
* Del 0002-monitor-refactor-checkpoint-update.patch
|
||||
* Del 0003-Super-intel-Fix-first-checkpoint-restart.patch
|
||||
* Del 0004-Grow-Move-update_tail-assign-to-Grow_reshape.patch
|
||||
* Del 0005-Add-understanding-output-section-in-man.patch
|
||||
* Del 0006-util.c-change-devnm-to-const-in-mdmon-functions.patch
|
||||
* Del 0007-Wait-for-mdmon-when-it-is-stared-via-systemd.patch
|
||||
* Del 0008-Detail-remove-duplicated-code.patch
|
||||
* Del 0009-mdadm-Fix-native-detail-export.patch
|
||||
|
||||
- Use obs_scm for code maintenance
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 22 16:00:35 UTC 2025 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
- Drop rcFOO symlinks for CODE16 (PED-266).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 18 15:43:37 UTC 2024 - Coly Li <colyli@suse.de>
|
||||
|
||||
- Detail: remove duplicated code (bsc#1226413)
|
||||
0008-Detail-remove-duplicated-code.patch
|
||||
- mdadm: Fix native --detail --export (bsc#1226413)
|
||||
0009-mdadm-Fix-native-detail-export.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jul 6 15:43:04 UTC 2024 - Coly Li <colyli@suse.de>
|
||||
|
||||
|
4
mdadm.obsinfo
Normal file
4
mdadm.obsinfo
Normal file
@@ -0,0 +1,4 @@
|
||||
name: mdadm
|
||||
version: 4.4
|
||||
mtime: 1734083693
|
||||
commit: 8e56efac9afd7080bb42bae4b77cdad5f345633a
|
29
mdadm.spec
29
mdadm.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package mdadm
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -22,7 +22,7 @@
|
||||
%endif
|
||||
|
||||
Name: mdadm
|
||||
Version: 4.3
|
||||
Version: 4.4
|
||||
Release: 0
|
||||
BuildRequires: binutils-devel
|
||||
BuildRequires: groff
|
||||
@@ -31,6 +31,9 @@ BuildRequires: sgmltool
|
||||
BuildRequires: pkgconfig(libudev)
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
BuildRequires: pkgconfig(udev)
|
||||
%if 0%{?suse_version} < 1550
|
||||
BuildRequires: suse-module-tools
|
||||
%endif
|
||||
PreReq: %fillup_prereq
|
||||
PreReq: coreutils
|
||||
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
|
||||
@@ -38,21 +41,20 @@ Summary: Utility for configuring "MD" software RAID devices
|
||||
License: GPL-2.0-only
|
||||
Group: System/Base
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Source: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz
|
||||
Source: %{name}-%{version}.tar
|
||||
Source1: Software-RAID.HOWTO.tar.bz2
|
||||
Source2: sysconfig.mdadm
|
||||
Patch1: 0001-Remove-hardcoded-checkpoint-interval-checking.patch
|
||||
Patch2: 0002-monitor-refactor-checkpoint-update.patch
|
||||
Patch3: 0003-Super-intel-Fix-first-checkpoint-restart.patch
|
||||
Patch4: 0004-Grow-Move-update_tail-assign-to-Grow_reshape.patch
|
||||
Patch5: 0005-Add-understanding-output-section-in-man.patch
|
||||
Patch6: 0006-util.c-change-devnm-to-const-in-mdmon-functions.patch
|
||||
Patch7: 0007-Wait-for-mdmon-when-it-is-stared-via-systemd.patch
|
||||
Patch0010: 0010-mdopen-add-sbin-path-to-env-PATH-when-call-system-mo.patch
|
||||
Patch1000: 1000-Revert-mdmonitor-Abandon-custom-configuration-files.patch
|
||||
Patch1001: 1001-display-timeout-status.patch
|
||||
Patch1002: 1002-OnCalendar-format-fix-of-mdcheck_start-timer.patch
|
||||
Patch1003: 1003-mdadm-treat-the-Dell-softraid-array-as-local-array.patch
|
||||
Patch1004: 1004-call-mdadm_env.sh-from-usr-libexec-mdadm.patch
|
||||
Patch1005: 1005-mdadm-enable-Intel-Alderlake-RSTe-configuration.patch
|
||||
Patch1006: 1006-imsm-Fix-RAID0-to-RAID10-migration.patch
|
||||
Patch1007: 1007-mdadm-allow-any-valid-minor-number-in-md-device-name.patch
|
||||
Patch1008: 1008-mdmonitor-use-MAILFROM-to-set-sendmail-envelope-send.patch
|
||||
|
||||
%define _udevdir %(pkg-config --variable=udevdir udev)
|
||||
%define _systemdshutdowndir %{_unitdir}/../system-shutdown
|
||||
|
||||
@@ -63,7 +65,7 @@ mdadm is a program that can be used to control Linux md devices.
|
||||
%autosetup -p1 -a1
|
||||
|
||||
%build
|
||||
make %{?_smp_mflags} CC="%__cc" CXFLAGS="%{optflags} -Wno-error" EXTRAVERSION="%{release}" SUSE=yes BINDIR=%{_sbindir}
|
||||
%make_build CC="%{__cc}" CXFLAGS="%{optflags} -Wno-error" SUSE=yes BINDIR="%{_sbindir}"
|
||||
cd Software-RAID.HOWTO
|
||||
sgml2html Software-RAID.HOWTO.sgml
|
||||
sgml2txt Software-RAID.HOWTO.sgml
|
||||
@@ -77,7 +79,9 @@ install -m 755 misc/mdcheck %{buildroot}/usr/share/mdadm/mdcheck
|
||||
install -m 644 %{S:2} %{buildroot}%{_fillupdir}/
|
||||
install -d %{buildroot}%{_systemdshutdowndir}
|
||||
install -d %{buildroot}%{_sbindir}
|
||||
%if 0%{?suse_version} < 1600
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcmdmonitor
|
||||
%endif
|
||||
%if 0%{?suse_version} < 1550
|
||||
mkdir -p %{buildroot}/sbin
|
||||
ln -s %{_sbindir}/mdadm %{buildroot}/sbin/mdadm
|
||||
@@ -107,7 +111,8 @@ ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcmdmonitor
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%license COPYING
|
||||
%doc ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs
|
||||
%doc CHANGELOG.md documentation/mdadm.conf-example
|
||||
%doc documentation/external-reshape-design.txt documentation/mdmon-design.txt
|
||||
%doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html}
|
||||
%doc %{_mandir}/man?/*
|
||||
%{_sbindir}/*
|
||||
|
Reference in New Issue
Block a user