Skip to content

Commit

Permalink
libceph: flush msgr queue during mon_client shutdown
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit f3dea7e)
  • Loading branch information
Sage Weil authored and Alex Elder committed Jun 20, 2012
1 parent b132cf4 commit 642c0db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 0 additions & 7 deletions net/ceph/ceph_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,6 @@ void ceph_destroy_client(struct ceph_client *client)
/* unmount */
ceph_osdc_stop(&client->osdc);

/*
* make sure osd connections close out before destroying the
* auth module, which is needed to free those connections'
* ceph_authorizers.
*/
ceph_msgr_flush();

ceph_monc_stop(&client->monc);

ceph_debugfs_client_cleanup(client);
Expand Down
8 changes: 8 additions & 0 deletions net/ceph/mon_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,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);
Expand Down

0 comments on commit 642c0db

Please sign in to comment.