Skip to contentSkip to conversation

dlm: configfs lock

PATCH New David Teigland 1 participant 1 message Nov 7, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 dlm: configfs lock

Need to hold the subsys semaphore while accessing the children list.

----

drivers/dlm/config.c +4 -1
diff -ur a/drivers/dlm/config.c b/drivers/dlm/config.c
@@ -627,12 +627,14 @@
 static struct comm *get_comm(int nodeid, struct sockaddr_storage *addr)
 {
 	struct config_item *i;
-	struct comm *cm;
+	struct comm *cm = NULL;
 	int found = 0;
 
 	if (!comm_list)
 		return NULL;
 
+	down(&clusters_root.subsys.su_sem);
+
 	list_for_each_entry(i, &comm_list->cg_children, ci_entry) {
 		cm = to_comm(i);
 
@@ -649,6 +651,7 @@
 			break;
 		}
 	}
+	up(&clusters_root.subsys.su_sem);
 
 	if (found)
 		config_item_get(i);