summaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-06-20 15:22:50 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-06-21 09:49:47 +0200
commitf98340f1b830d950978abba752b2b9b004528faf (patch)
tree39d84a50e0d0cacee34d8477a23ebbc9cb635b26 /msg.c
parentmdadm/tests: judge foreign array in test cases (diff)
downloadmdadm-f98340f1b830d950978abba752b2b9b004528faf.tar.xz
mdadm-f98340f1b830d950978abba752b2b9b004528faf.zip
Revert "mdadm: Fix socket connection failure when mdmon runs in foreground mode."
This reverts commit 66a54b266f6c579e5f37b6253820903a55c3346c. connect_monitor() is called from ping_monitor() but this function is often used as advice, without verification that mdmon is really working. This produces hangs in many scenarios. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/msg.c b/msg.c
index d17f679d..f0772b3f 100644
--- a/msg.c
+++ b/msg.c
@@ -151,7 +151,6 @@ int connect_monitor(char *devname)
struct sockaddr_un addr;
int pos;
char *c;
- int rv, retry_count = 0;
pos = sprintf(path, "%s/", MDMON_DIR);
if (is_subarray(devname)) {
@@ -171,24 +170,7 @@ int connect_monitor(char *devname)
addr.sun_family = PF_LOCAL;
strcpy(addr.sun_path, path);
-
- /* In foreground mode, when mdadm is trying to connect to control
- * socket it is possible that the mdmon has not created it yet.
- * Give some time to mdmon to create socket.
- */
- for (retry_count = 0; retry_count < 10; retry_count++) {
- rv = connect(sfd, (struct sockaddr*)&addr, sizeof(addr));
-
- if (rv < 0) {
- sleep_for(0, MSEC_TO_NSEC(200), true);
- continue;
- }
- break;
- }
-
- if (rv < 0) {
- pr_err("Failed to connect to control socket. (%s!!)\n",
- strerror(errno));
+ if (connect(sfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
close(sfd);
return -1;
}