aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPatrick Caulfield <pcaulfie@redhat.com>2007-06-01 11:07:26 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2007-07-09 03:23:05 -0400
commitafb853fb4eec380b492a3c369f837359359c28e8 (patch)
treeee589e832761f6915db48a222288f68164874a05 /fs
parent89918647a445fddfe223b097e29f775dcfa81eab (diff)
[DLM] fix socket shutdown
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> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/dlm/lowcomms.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 27970a58d29b..fc0bff74c61e 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -260,7 +260,7 @@ static int nodeid_to_addr(int nodeid, struct sockaddr *retaddr)
260static void lowcomms_data_ready(struct sock *sk, int count_unused) 260static void lowcomms_data_ready(struct sock *sk, int count_unused)
261{ 261{
262 struct connection *con = sock2con(sk); 262 struct connection *con = sock2con(sk);
263 if (!test_and_set_bit(CF_READ_PENDING, &con->flags)) 263 if (con && !test_and_set_bit(CF_READ_PENDING, &con->flags))
264 queue_work(recv_workqueue, &con->rwork); 264 queue_work(recv_workqueue, &con->rwork);
265} 265}
266 266
@@ -268,7 +268,7 @@ static void lowcomms_write_space(struct sock *sk)
268{ 268{
269 struct connection *con = sock2con(sk); 269 struct connection *con = sock2con(sk);
270 270
271 if (!test_and_set_bit(CF_WRITE_PENDING, &con->flags)) 271 if (con && !test_and_set_bit(CF_WRITE_PENDING, &con->flags))
272 queue_work(send_workqueue, &con->swork); 272 queue_work(send_workqueue, &con->swork);
273} 273}
274 274
@@ -1400,8 +1400,11 @@ void dlm_lowcomms_stop(void)
1400 down(&connections_lock); 1400 down(&connections_lock);
1401 for (i = 0; i <= max_nodeid; i++) { 1401 for (i = 0; i <= max_nodeid; i++) {
1402 con = __nodeid2con(i, 0); 1402 con = __nodeid2con(i, 0);
1403 if (con) 1403 if (con) {
1404 con->flags |= 0xFF; 1404 con->flags |= 0xFF;
1405 if (con->sock)
1406 con->sock->sk->sk_user_data = NULL;
1407 }
1405 } 1408 }
1406 up(&connections_lock); 1409 up(&connections_lock);
1407 1410