summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog5
-rw-r--r--debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch47
-rw-r--r--debian/patches/series1
3 files changed, 53 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index d91676ff..8aefbb95 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,11 @@ mdadm (3.3.2-3) UNRELEASED; urgency=low
last change) (Closes: #764036)
* remove set -u (error on unset variables) from maintscripts
(Closes: #766308)
+ * rebuildmap-strip-local-host-name-from-device-name.patch - a patch
+ from upstream fixing a bug when mdadm have to re-create device
+ nodes after assembling arrays (eg, when switching from initramfs
+ without preserving /dev and /run), to choose the same device names
+ as when doing inital assembly
-- Michael Tokarev <mjt@tls.msk.ru> Mon, 06 Oct 2014 11:28:42 +0400
diff --git a/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch b/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch
new file mode 100644
index 00000000..f7c9b1b7
--- /dev/null
+++ b/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch
@@ -0,0 +1,47 @@
+From 628cdf19ea35daad22e409e51c0abc7ffb19d6aa Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Mon, 3 Nov 2014 12:49:05 +1100
+Subject: Rebuildmap: strip local host name from device name.
+
+When /run/mdadm/map is being rebuilt, e.g. by "mdadm -Ir",
+if the device doesn't exist in /dev, we have to choose
+a name.
+Currently we don't strip the hostname which is wrong if
+it is the local host.
+
+Reported-by: Stephen Kent <smkent@smkent.net>
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ mapfile.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/mapfile.c b/mapfile.c
+index 4e7f242..41599df 100644
+--- a/mapfile.c
++++ b/mapfile.c
+@@ -455,12 +455,19 @@ void RebuildMap(void)
+ sep = "";
+ }
+ }
+- if (strchr(name, ':'))
+- /* probably a uniquifying
++ if (strchr(name, ':')) {
++ /* Probably a uniquifying
+ * hostname prefix. Allow
+- * without a suffix
++ * without a suffix, and strip
++ * hostname if it is us.
+ */
++ if (homehost && unum == -1 &&
++ strncmp(name, homehost,
++ strlen(homehost)) == 0 &&
++ name[strlen(homehost)] == ':')
++ name += strlen(homehost)+1;
+ unum = -1;
++ }
+
+ while (conflict) {
+ if (unum >= 0)
+--
+1.7.10.4
+
diff --git a/debian/patches/series b/debian/patches/series
index 956eedd8..6132de5c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ debian-no-Werror.diff
sha1-includes.diff
use-external-blkid.diff
build-sys-no-check_rundir.patch
+rebuildmap-strip-local-host-name-from-device-name.patch