cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: pcaulfield@sourceware.org <pcaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/dlm-kernel/src lowcomms.c
Date: 6 Aug 2007 14:40:51 -0000	[thread overview]
Message-ID: <20070806144051.1880.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	pcaulfield at sourceware.org	2007-08-06 14:40:50

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=RHEL4&r1=1.22.2.15&r2=1.22.2.16

--- cluster/dlm-kernel/src/Attic/lowcomms.c	2007/07/16 09:26:05	1.22.2.15
+++ cluster/dlm-kernel/src/Attic/lowcomms.c	2007/08/06 14:40:50	1.22.2.16
@@ -315,15 +315,23 @@
 		   will only re-enter once.
 		*/
 		close_connection(con->othercon, FALSE);
-		kmem_cache_free(con_cache, con->othercon);
-		con->othercon = NULL;
 	}
 	if (con->rx_page) {
 		__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 */
@@ -426,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 */
 	}
@@ -1206,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]);
 		}
 	}



             reply	other threads:[~2007-08-06 14:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-06 14:40 pcaulfield [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-11-07 18:55 [Cluster-devel] cluster/dlm-kernel/src lowcomms.c lhh
2007-11-07 15:24 lhh
2007-11-07 15:22 lhh
2007-10-30 17:42 lhh
2007-10-30 17:41 lhh
2007-08-13 20:09 pcaulfield
2007-08-13 20:07 pcaulfield
2007-08-06 14:46 pcaulfield
2007-07-16  9:27 pcaulfield
2007-07-16  9:26 pcaulfield
2007-06-27 12:38 pcaulfield
2007-06-27 10:39 pcaulfield
2006-09-26 16:39 teigland
2006-09-12 14:48 pcaulfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070806144051.1880.qmail@sourceware.org \
    --to=pcaulfield@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).