summaryrefslogtreecommitdiff
path: root/net/ceph/mon_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-06-11 07:43:56 +0400
committerSage Weil <sage@inktank.com>2012-06-15 22:26:40 +0400
commitf3dea7edd3d449fe7a6d402c1ce56a294b985261 (patch)
treedd8d3334a38320ba7918ca9ccc6e8fe2f943c867 /net/ceph/mon_client.c
parent89a86be0ce20022f6ede8bccec078dbb3d63caaa (diff)
downloadlinux-f3dea7edd3d449fe7a6d402c1ce56a294b985261.tar.xz
libceph: flush msgr queue during mon_client shutdown
We need to flush the msgr workqueue during mon_client shutdown to ensure that any work affecting our embedded ceph_connection is finished so that we can be safely destroyed. Previously, we were flushing the work queue after osd_client shutdown and before mon_client shutdown to ensure that any osd connection refs to authorizers are flushed. Remove the redundant flush, and document in the comment that the mon_client flush is needed to cover that case as well. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'net/ceph/mon_client.c')
-rw-r--r--net/ceph/mon_client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
index 7a16750d62a6..dc16595d6885 100644
--- a/net/ceph/mon_client.c
+++ b/net/ceph/mon_client.c
@@ -838,6 +838,14 @@ void ceph_monc_stop(struct ceph_mon_client *monc)
mutex_unlock(&monc->mutex);
+ /*
+ * flush msgr queue before we destroy ourselves to ensure that:
+ * - any work that references our embedded con is finished.
+ * - any osd_client or other work that may reference an authorizer
+ * finishes before we shut down the auth subsystem.
+ */
+ ceph_msgr_flush();
+
ceph_auth_destroy(monc->auth);
ceph_msg_put(monc->m_auth);