Skip to content

Commit 642c0db

Browse files
Sage WeilAlex Elder
authored andcommitted
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 <[email protected]> Reviewed-by: Alex Elder <[email protected]> (cherry picked from commit f3dea7e)
1 parent b132cf4 commit 642c0db

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

net/ceph/ceph_common.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,6 @@ void ceph_destroy_client(struct ceph_client *client)
504504
/* unmount */
505505
ceph_osdc_stop(&client->osdc);
506506

507-
/*
508-
* make sure osd connections close out before destroying the
509-
* auth module, which is needed to free those connections'
510-
* ceph_authorizers.
511-
*/
512-
ceph_msgr_flush();
513-
514507
ceph_monc_stop(&client->monc);
515508

516509
ceph_debugfs_client_cleanup(client);

net/ceph/mon_client.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,14 @@ void ceph_monc_stop(struct ceph_mon_client *monc)
847847

848848
mutex_unlock(&monc->mutex);
849849

850+
/*
851+
* flush msgr queue before we destroy ourselves to ensure that:
852+
* - any work that references our embedded con is finished.
853+
* - any osd_client or other work that may reference an authorizer
854+
* finishes before we shut down the auth subsystem.
855+
*/
856+
ceph_msgr_flush();
857+
850858
ceph_auth_destroy(monc->auth);
851859

852860
ceph_msg_put(monc->m_auth);

0 commit comments

Comments
 (0)