[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/dlm-kernel/src lowcomms.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL45
Changes by:	pcaulfield sourceware org	2007-08-06 14:46:48

Modified files:
	dlm-kernel/src : lowcomms.c 

Log message:
	Clean out 'othercon' structures when the connection is closed.
	bz#245828 comments 15->19 &
	bz#248957 comment 3

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/lowcomms.c.diff?cvsroot=cluster&only_with_tag=RHEL45&r1=1.22.2.13.2.1&r2=1.22.2.13.2.2

--- cluster/dlm-kernel/src/Attic/lowcomms.c	2007/06/27 12:38:23	1.22.2.13.2.1
+++ cluster/dlm-kernel/src/Attic/lowcomms.c	2007/08/06 14:46:48	1.22.2.13.2.2
@@ -320,8 +320,18 @@
 		__free_page(con->rx_page);
 		con->rx_page = NULL;
 	}
-	con->retries = 0;
-	up_write(&con->sock_sem);
+	/* If we are an 'othercon' then NULL the pointer to us
+	   from the parent and tidy ourself up */
+	if (test_bit(CF_IS_OTHERCON, &con->flags)) {
+		struct connection *parent = connections[con->nodeid];
+		parent->othercon = NULL;
+		kmem_cache_free(con_cache, con);
+	}
+	else {
+		/* Parent connections get reused */
+		con->retries = 0;
+		up_write(&con->sock_sem);
+	}
 }
 
 /* Data received from remote end */
@@ -424,7 +434,7 @@
 
       out_close:
 	up_read(&con->sock_sem);
-	if (ret != -EAGAIN && !test_bit(CF_IS_OTHERCON, &con->flags)) {
+	if (ret != -EAGAIN) {
 		close_connection(con, FALSE);
 		/* Reconnect when there is something to send */
 	}
@@ -1204,8 +1214,6 @@
 	for (i = 0; i < conn_array_size; i++) {
 		if (connections[i]) {
 			close_connection(connections[i], TRUE);
-			if (connections[i]->othercon)
-				kmem_cache_free(con_cache, connections[i]->othercon);
 			kmem_cache_free(con_cache, connections[i]);
 		}
 	}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]