From 9be06ec2337ae88d99a3bb40c8a721e228fa79eb Mon Sep 17 00:00:00 2001 From: Patrick Caulfield Date: Thu, 1 Feb 2007 16:46:33 +0000 Subject: [PATCH] --- yaml --- r: 46321 b: refs/heads/master c: a34fbc6363256387372331000462691bc4b3f5a9 h: refs/heads/master i: 46319: 3952ec12678a1d86dc07e7c26351cbba32c4926c v: v3 --- [refs] | 2 +- trunk/fs/dlm/lowcomms-tcp.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index d49999b6e5ac..0953adb41492 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 62a0f62369b0fece37f6652d69b918c89d53c3b3 +refs/heads/master: a34fbc6363256387372331000462691bc4b3f5a9 diff --git a/trunk/fs/dlm/lowcomms-tcp.c b/trunk/fs/dlm/lowcomms-tcp.c index 18ade44287e7..f1efd17b2614 100644 --- a/trunk/fs/dlm/lowcomms-tcp.c +++ b/trunk/fs/dlm/lowcomms-tcp.c @@ -2,7 +2,7 @@ ******************************************************************************* ** ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. -** Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. +** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. ** ** This copyrighted material is made available to anyone wishing to use, ** modify, copy, or redistribute it subject to the terms and conditions @@ -109,7 +109,6 @@ struct connection { struct page *rx_page; struct cbuf cb; int retries; - atomic_t waiting_requests; #define MAX_CONNECT_RETRIES 3 struct connection *othercon; struct work_struct rwork; /* Receive workqueue */ @@ -278,8 +277,11 @@ static int receive_from_sock(struct connection *con) mutex_lock(&con->sock_mutex); - if (con->sock == NULL) - goto out; + if (con->sock == NULL) { + ret = -EAGAIN; + goto out_close; + } + if (con->rx_page == NULL) { /* * This doesn't need to be atomic, but I think it should @@ -352,7 +354,6 @@ static int receive_from_sock(struct connection *con) con->rx_page = NULL; } -out: if (call_again_soon) goto out_resched; mutex_unlock(&con->sock_mutex); @@ -370,6 +371,9 @@ static int receive_from_sock(struct connection *con) close_connection(con, false); /* Reconnect when there is something to send */ } + /* Don't return success if we really got EOF */ + if (ret == 0) + ret = -EAGAIN; return ret; } @@ -847,7 +851,6 @@ int dlm_lowcomms_close(int nodeid) if (con) { clean_one_writequeue(con); close_connection(con, true); - atomic_set(&con->waiting_requests, 0); } return 0;