summaryrefslogtreecommitdiffstats
path: root/debian/patches/exit-gracefully-when-md-device-not-found.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-24 14:37:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-24 14:37:52 +0000
commit1cbda917747b894268cbe6ec6e576db26d9fd049 (patch)
treec88de9d39f187cf339e1add1f768bbda4a61130f /debian/patches/exit-gracefully-when-md-device-not-found.patch
parentAdding upstream version 4.2. (diff)
downloadmdadm-1cbda917747b894268cbe6ec6e576db26d9fd049.tar.xz
mdadm-1cbda917747b894268cbe6ec6e576db26d9fd049.zip
Adding debian version 4.2-5.debian/4.2-5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/exit-gracefully-when-md-device-not-found.patch')
-rw-r--r--debian/patches/exit-gracefully-when-md-device-not-found.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches/exit-gracefully-when-md-device-not-found.patch b/debian/patches/exit-gracefully-when-md-device-not-found.patch
new file mode 100644
index 0000000..c6a34d5
--- /dev/null
+++ b/debian/patches/exit-gracefully-when-md-device-not-found.patch
@@ -0,0 +1,25 @@
+Description: Exit gracefully when md device not found
+Author: Felix Lechner <felix.lechner@lease-up.com>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970329
+Forwarded: no
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Monitor.c
++++ b/Monitor.c
+@@ -539,8 +539,14 @@ static int check_array(struct state *st,
+ if (fd < 0)
+ goto disappeared;
+
+- if (st->devnm[0] == 0)
+- strcpy(st->devnm, fd2devnm(fd));
++ if (st->devnm[0] == 0) {
++ char *found = fd2devnm(fd);
++ if (!found) {
++ alert("DeviceDisappeared", dev, NULL, ainfo);
++ goto out;
++ }
++ strcpy(st->devnm, found);
++ }
+
+ for (mse2 = mdstat; mse2; mse2 = mse2->next)
+ if (strcmp(mse2->devnm, st->devnm) == 0) {