[Cluster-devel] [DLM][PATCH] keep from adding the local IP to dlm_local_addr again

Josef Bacik jwhiter at redhat.com
Fri Apr 20 21:29:25 UTC 2007


Hello,

This should be it for the lockspace weirdness patches.  When we go to initialize
the lowcomms stuff for a second time when using TCP, it fails complaining about
not being able to work on a multihoned machine.  This is because we've already
increased the dlm_local_count before when we did this the first time.  This
patch fixes this problem by only searching for our local address if we haven't
already gotten it.  Thank you,

Josef

Signed-off-by: Josef Bacik <jwhiter at redhat.com>

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 2b32f3c..4843a4b 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -131,7 +131,7 @@ struct writequeue_entry {
 };
 
 static struct sockaddr_storage *dlm_local_addr[DLM_MAX_ADDR_COUNT];
-static int dlm_local_count;
+static int dlm_local_count = 0;
 
 /* Work queues */
 static struct workqueue_struct *recv_workqueue;
@@ -1424,10 +1424,12 @@ int dlm_lowcomms_start(void)
 	int error = -EINVAL;
 	struct connection *con;
 
-	init_local();
 	if (!dlm_local_count) {
-		log_print("no local IP address has been set");
-		goto out;
+		init_local();
+		if (!dlm_local_count) {
+			log_print("no local IP address has been set");
+			goto out;
+		}
 	}
 
 	error = -ENOMEM;




More information about the Cluster-devel mailing list