diff options
author | Michael Tokarev <mjt@tls.msk.ru> | 2012-10-28 20:58:49 +0400 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2012-10-28 20:58:49 +0400 |
commit | df370a533916769caf91083b683485652970db2e (patch) | |
tree | 36c8896f166a9bea98453396b50e0dec28147c4d /debian/patches | |
parent | 2cf19e2722d872d88e5c5afd5b672b849734c912 (diff) |
several fixes for mdmon argument processing (#691671)
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/mdmon-allow-takeover-when-original-was-started-with-.patch | 37 | ||||
-rw-r--r-- | debian/patches/mdmon-fix-arg-parsing.patch | 32 | ||||
-rw-r--r-- | debian/patches/mdmon-fix-arg-processing-for-a.patch | 31 | ||||
-rw-r--r-- | debian/patches/series | 3 |
4 files changed, 103 insertions, 0 deletions
diff --git a/debian/patches/mdmon-allow-takeover-when-original-was-started-with-.patch b/debian/patches/mdmon-allow-takeover-when-original-was-started-with-.patch new file mode 100644 index 00000000..ad643e4c --- /dev/null +++ b/debian/patches/mdmon-allow-takeover-when-original-was-started-with-.patch @@ -0,0 +1,37 @@ +From c4e96a305fbca4f83ae9f3a81482481524380905 Mon Sep 17 00:00:00 2001 +From: NeilBrown <neilb@suse.de> +Date: Mon, 20 Aug 2012 10:37:21 +1000 +Subject: mdmon: allow --takeover when original was started with --offroot +Bug-Debian: http://bugs.debian.org/691671 +Comment: from stable/bugfix upstream 3.2.6 version +Comment: one of the 3 patches fixing mentioned issues + +As --offroot causes ARGV[0] to be changed, we need to be more +lenient when checking that the mdmon we are about to kill really +is mdmon. i.e. allow name to be "@dmon" instead. + +Signed-off-by: NeilBrown <neilb@suse.de> +--- + mdmon.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/mdmon.c b/mdmon.c +index 2d0503d..54e1238 100644 +--- a/mdmon.c ++++ b/mdmon.c +@@ -184,7 +184,11 @@ static void try_kill_monitor(pid_t pid, char *devname, int sock) + buf[sizeof(buf)-1] = 0; + close(fd); + +- if (n < 0 || !strstr(buf, "mdmon")) ++ /* Note that if started with --offroot, the name ++ * might be "@dmon" ++ */ ++ if (n < 0 || !(strstr(buf, "mdmon") || ++ strstr(buf, "@dmon"))) + return; + + kill(pid, SIGTERM); +-- +1.7.10.4 + diff --git a/debian/patches/mdmon-fix-arg-parsing.patch b/debian/patches/mdmon-fix-arg-parsing.patch new file mode 100644 index 00000000..5c147ccd --- /dev/null +++ b/debian/patches/mdmon-fix-arg-parsing.patch @@ -0,0 +1,32 @@ +From 68ad53b301b6fc722fee6d32a5267c1a4506452d Mon Sep 17 00:00:00 2001 +From: NeilBrown <neilb@suse.de> +Date: Mon, 9 Jul 2012 16:50:22 +1000 +Subject: mdmon: fix arg parsing. +Bug-Debian: http://bugs.debian.org/691671 +Comment: from stable/bugfix upstream 3.2.6 version +Comment: one of the 3 patches fixing mentioned issues + +-t aka --takeover should not be setting container_name. +It sets it to NULL which causes failure when you try + mdmon --all --takeover + +Signed-off-by: NeilBrown <neilb@suse.de> +--- + mdmon.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/mdmon.c b/mdmon.c +index 2093476..dee02a9 100644 +--- a/mdmon.c ++++ b/mdmon.c +@@ -306,7 +306,6 @@ int main(int argc, char *argv[]) + all = 1; + break; + case 't': +- container_name = optarg; + takeover = 1; + break; + case OffRootOpt: +-- +1.7.10.4 + diff --git a/debian/patches/mdmon-fix-arg-processing-for-a.patch b/debian/patches/mdmon-fix-arg-processing-for-a.patch new file mode 100644 index 00000000..c7f66a59 --- /dev/null +++ b/debian/patches/mdmon-fix-arg-processing-for-a.patch @@ -0,0 +1,31 @@ +From 23084aaa76d9fc3121ff2ab38c04ee9893793e00 Mon Sep 17 00:00:00 2001 +From: NeilBrown <neilb@suse.de> +Date: Mon, 20 Aug 2012 10:33:50 +1000 +Subject: mdmon: fix arg processing for -a +Bug-Debian: http://bugs.debian.org/691671 +Comment: from stable/bugfix upstream 3.2.6 version +Comment: one of the 3 patches fixing mentioned issues + +'-a' was not being recognised as an abbreviation for '--all'. + +Signed-off-by: NeilBrown <neilb@suse.de> +--- + mdmon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mdmon.c b/mdmon.c +index dee02a9..2d0503d 100644 +--- a/mdmon.c ++++ b/mdmon.c +@@ -299,7 +299,7 @@ int main(int argc, char *argv[]) + {NULL, 0, NULL, 0} + }; + +- while ((opt = getopt_long(argc, argv, "th", options, NULL)) != -1) { ++ while ((opt = getopt_long(argc, argv, "tha", options, NULL)) != -1) { + switch (opt) { + case 'a': + container_name = argv[optind-1]; +-- +1.7.10.4 + diff --git a/debian/patches/series b/debian/patches/series index 3b3e86d2..370ad9a2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,6 @@ spelling-and-manpages.patch fix-enough-function-for-RAID10.patch fix-segfaults-in-detail.patch super0-do-not-override-uuid-with-homehost.patch +mdmon-allow-takeover-when-original-was-started-with-.patch +mdmon-fix-arg-parsing.patch +mdmon-fix-arg-processing-for-a.patch |