diff options
author | Sage Weil <sage@inktank.com> | 2012-06-10 23:43:56 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-06-15 14:26:40 -0400 |
commit | f3dea7edd3d449fe7a6d402c1ce56a294b985261 (patch) | |
tree | dd8d3334a38320ba7918ca9ccc6e8fe2f943c867 /net/ceph | |
parent | 89a86be0ce20022f6ede8bccec078dbb3d63caaa (diff) |
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')
-rw-r--r-- | net/ceph/ceph_common.c | 7 | ||||
-rw-r--r-- | net/ceph/mon_client.c | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index 2de3ea1bbd64..c815f31a1a3f 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c | |||
@@ -498,13 +498,6 @@ void ceph_destroy_client(struct ceph_client *client) | |||
498 | /* unmount */ | 498 | /* unmount */ |
499 | ceph_osdc_stop(&client->osdc); | 499 | ceph_osdc_stop(&client->osdc); |
500 | 500 | ||
501 | /* | ||
502 | * make sure osd connections close out before destroying the | ||
503 | * auth module, which is needed to free those connections' | ||
504 | * ceph_authorizers. | ||
505 | */ | ||
506 | ceph_msgr_flush(); | ||
507 | |||
508 | ceph_monc_stop(&client->monc); | 501 | ceph_monc_stop(&client->monc); |
509 | 502 | ||
510 | ceph_debugfs_client_cleanup(client); | 503 | ceph_debugfs_client_cleanup(client); |
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) | |||
838 | 838 | ||
839 | mutex_unlock(&monc->mutex); | 839 | mutex_unlock(&monc->mutex); |
840 | 840 | ||
841 | /* | ||
842 | * flush msgr queue before we destroy ourselves to ensure that: | ||
843 | * - any work that references our embedded con is finished. | ||
844 | * - any osd_client or other work that may reference an authorizer | ||
845 | * finishes before we shut down the auth subsystem. | ||
846 | */ | ||
847 | ceph_msgr_flush(); | ||
848 | |||
841 | ceph_auth_destroy(monc->auth); | 849 | ceph_auth_destroy(monc->auth); |
842 | 850 | ||
843 | ceph_msg_put(monc->m_auth); | 851 | ceph_msg_put(monc->m_auth); |