[ 150/171] libceph: close socket directly from ceph_con_close()

From: Greg Kroah-Hartman
Date: Thu Nov 22 2012 - 17:33:43 EST


3.4-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sage Weil <sage@xxxxxxxxxxx>

(cherry picked from commit ee76e0736db8455e3b11827d6899bd2a4e1d0584)

It is simpler to do this immediately, since we already hold the con mutex.
It also avoids the need to deal with a not-quite-CLOSED socket in con_work.

Signed-off-by: Sage Weil <sage@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
net/ceph/messenger.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -519,14 +519,8 @@ void ceph_con_close(struct ceph_connecti
reset_connection(con);
con->peer_global_seq = 0;
cancel_delayed_work(&con->work);
+ con_close_socket(con);
mutex_unlock(&con->mutex);
-
- /*
- * We cannot close the socket directly from here because the
- * work threads use it without holding the mutex. Instead, let
- * con_work() do it.
- */
- queue_con(con);
}
EXPORT_SYMBOL(ceph_con_close);



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/