Skip to contentSkip to conversation

keep from adding the local IP to dlm_local_addr again

PATCH New Josef Bacik 1 participant 1 message Apr 20, 2007 Distributed lock manager (DLM)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 keep from adding the local IP to dlm_local_addr again

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

fs/dlm/lowcomms.c +6 -4
index 2b32f3c..4843a4b 100644
@@ -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;