Refreshing exit-gracefully-when-md-device-not-found.patch.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
d0d9648c22
commit
27972f165d
3 changed files with 24 additions and 26 deletions
23
debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch
vendored
Normal file
23
debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch
vendored
Normal file
|
@ -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("DeviceDisappeared", dev, NULL, ainfo);
|
||||
+ goto out;
|
||||
+ }
|
||||
+ snprintf(st->devnm, MD_NAME_MAX, "%s", found);
|
||||
+ }
|
||||
|
||||
for (mse2 = mdstat; mse2; mse2 = mse2->next)
|
||||
if (strcmp(mse2->devnm, st->devnm) == 0) {
|
|
@ -1,25 +0,0 @@
|
|||
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) {
|
2
debian/patches/series
vendored
2
debian/patches/series
vendored
|
@ -1,7 +1,7 @@
|
|||
debian/0001-fix-manpages.patch
|
||||
debian/0002-mdmonitor-service-simplify.patch
|
||||
debian/0003-host-name-in-default-mailfrom.patch
|
||||
exit-gracefully-when-md-device-not-found.patch
|
||||
debian/0004-exit-gracefully-when-md-device-not-found.patch
|
||||
sha1-includes.diff
|
||||
readlink-path.patch
|
||||
debian-no-Werror.diff
|
||||
|
|
Loading…
Add table
Reference in a new issue