cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] dlm: fix socket shutdown
@ 2007-06-01 15:07 David Teigland
  2007-06-04  8:50 ` [Cluster-devel] " Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: David Teigland @ 2007-06-01 15:07 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Patrick Caulfield <pcaulfie@redhat.com>

This patch clears the user_data of active sockets as part of cleanup.
This prevents any late-arriving data from trying to add jobs to the work
queue while we are tidying up.

Signed-Off-By: Patrick Caulfield <pcaulfie@redhat.com>
Signed-Off-By: David Teigland <teigland@redhat.com>

Index: linux-quilt/fs/dlm/lowcomms.c
===================================================================
--- linux-quilt.orig/fs/dlm/lowcomms.c	2007-05-25 14:56:42.000000000 -0500
+++ linux-quilt/fs/dlm/lowcomms.c	2007-06-01 10:04:03.000000000 -0500
@@ -260,7 +260,7 @@
 static void lowcomms_data_ready(struct sock *sk, int count_unused)
 {
 	struct connection *con = sock2con(sk);
-	if (!test_and_set_bit(CF_READ_PENDING, &con->flags))
+	if (con && !test_and_set_bit(CF_READ_PENDING, &con->flags))
 		queue_work(recv_workqueue, &con->rwork);
 }
 
@@ -268,7 +268,7 @@
 {
 	struct connection *con = sock2con(sk);
 
-	if (!test_and_set_bit(CF_WRITE_PENDING, &con->flags))
+	if (con && !test_and_set_bit(CF_WRITE_PENDING, &con->flags))
 		queue_work(send_workqueue, &con->swork);
 }
 
@@ -1400,8 +1400,11 @@
 	down(&connections_lock);
 	for (i = 0; i <= max_nodeid; i++) {
 		con = __nodeid2con(i, 0);
-		if (con)
+		if (con) {
 			con->flags |= 0xFF;
+			if (con->sock)
+				con->sock->sk->sk_user_data = NULL;
+		}
 	}
 	up(&connections_lock);
 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-04  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-01 15:07 [Cluster-devel] [PATCH] dlm: fix socket shutdown David Teigland
2007-06-04  8:50 ` [Cluster-devel] " Steven Whitehouse

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).