]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
libceph: close socket directly from ceph_con_close()
authorSage Weil <sage@inktank.com>
Fri, 20 Jul 2012 23:45:49 +0000 (16:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Nov 2012 19:38:40 +0000 (11:38 -0800)
(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@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ceph/messenger.c

index 7bd757cb01af756fddc5ed2f6fbba183f001b4e5..49f78ff624789a9dabaf4e34f296e4a6bf11ac4c 100644 (file)
@@ -519,14 +519,8 @@ void ceph_con_close(struct ceph_connection *con)
        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);