From 84a230d993d6a953876f3b83ae79ed519ebf4d07 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 7 Nov 2011 11:37:12 +1100 Subject: [PATCH] Revert "mdmon(): Error out if failing to connect to victim monitor" This reverts commit 819c158866f466075a1c719f0dc496deb2fb3814. Adam Kwolek reports that with this patch, mdmon sometimes doesn't start: When array is not clean dismounted directory /dev/.mdadm is not cleaned up. On array re-assembly read pid is not valid and it is not possible to connect to monitor. This causes mdmon to exit and array remains not monitored. Problem is introduced by fix: mdmon(): Error out if failing to connect to victim monitor 819c158866f466075a1c719f0dc496deb2fb3814 This is critical for container reshape when mdmon is should finish reshape. when reshape is not finished, array is reshaped again by mdadm. As victim_sock is subsequently tested, we don't really need to test-and-fail here. Reported-by: Adam Kwolek Signed-off-by: NeilBrown --- mdmon.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mdmon.c b/mdmon.c index bdcda0e..ee68e3c 100644 --- a/mdmon.c +++ b/mdmon.c @@ -457,14 +457,8 @@ static int mdmon(char *devname, int devnum, int must_fork, int takeover) sigaction(SIGPIPE, &act, NULL); victim = mdmon_pid(container->devnum); - if (victim >= 0) { + if (victim >= 0) victim_sock = connect_monitor(container->devname); - if (victim_sock < 0) { - fprintf(stderr, "mdmon: %s unable to connect monitor\n", - container->devname); - exit(3); - } - } ignore = chdir("/"); if (!takeover && victim > 0 && victim_sock >= 0) {