summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:55:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:55:45 +0000
commit2c958b35ba11c61dd2b7416d2f6067655512d2b9 (patch)
tree4beee0533c06469c7d12d2493f59b0add009c75e /debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch
parentAdding upstream version 4.3. (diff)
downloadmdadm-2c958b35ba11c61dd2b7416d2f6067655512d2b9.tar.xz
mdadm-2c958b35ba11c61dd2b7416d2f6067655512d2b9.zip
Adding debian version 4.3-1.debian/4.3-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch')
-rw-r--r--debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch b/debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch
new file mode 100644
index 0000000..225a8a3
--- /dev/null
+++ b/debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch
@@ -0,0 +1,23 @@
+Author: Felix Lechner <felix.lechner@lease-up.com>
+Description: Exit gracefully when md device not found (Closes: #970329).
+
+diff -Naurp mdadm.orig/Monitor.c mdadm/Monitor.c
+--- mdadm.orig/Monitor.c
++++ mdadm/Monitor.c
+@@ -554,8 +554,14 @@ static int check_array(struct state *st,
+ if (fd < 0)
+ goto disappeared;
+
+- if (st->devnm[0] == 0)
+- snprintf(st->devnm, MD_NAME_MAX, "%s", fd2devnm(fd));
++ if (st->devnm[0] == 0) {
++ char *found = fd2devnm(fd);
++ if (!found) {
++ alert(EVENT_DEVICE_DISAPPEARED, NULL, 0, dev, NULL);
++ goto out;
++ }
++ snprintf(st->devnm, MD_NAME_MAX, "%s", found);
++ }
+
+ for (mse2 = mdstat; mse2; mse2 = mse2->next)
+ if (strcmp(mse2->devnm, st->devnm) == 0) {