ceph: close out mds, osd connections before stopping auth
authorSage Weil <sage@newdream.net>
Sat, 29 May 2010 16:41:23 +0000 (09:41 -0700)
committerSage Weil <sage@newdream.net>
Sat, 29 May 2010 16:42:03 +0000 (09:42 -0700)
The auth module (part of the mon_client) is needed to free any
ceph_authorizer(s) used by the mds and osd connections.  Flush the msgr
workqueue before stopping monc to ensure that the destroy_authorizer
auth op is available when those connections are closed out.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/messenger.c
fs/ceph/messenger.h
fs/ceph/super.c

index 60b74839ebec4dd233206d56d25a2bd7356a12ee..64b8b1f7863d7af7cbca11bfee570209a10d3e3e 100644 (file)
@@ -120,6 +120,12 @@ void ceph_msgr_exit(void)
        destroy_workqueue(ceph_msgr_wq);
 }
 
+void ceph_msgr_flush()
+{
+       flush_workqueue(ceph_msgr_wq);
+}
+
+
 /*
  * socket callback functions
  */
index 00a9430b1ffc245649ea05b1f3498e9f20708b76..76fbc957bc137dab063cdd69abcc1b432800aa51 100644 (file)
@@ -213,6 +213,7 @@ extern int ceph_parse_ips(const char *c, const char *end,
 
 extern int ceph_msgr_init(void);
 extern void ceph_msgr_exit(void);
+extern void ceph_msgr_flush(void);
 
 extern struct ceph_messenger *ceph_messenger_create(
        struct ceph_entity_addr *myaddr);
index 9b46bb951e1f56c71bf539f4850911ac63facc17..5cf6fba8b705f8da50499d3436795e4558fe5395 100644 (file)
@@ -669,9 +669,17 @@ static void ceph_destroy_client(struct ceph_client *client)
 
        /* unmount */
        ceph_mdsc_stop(&client->mdsc);
-       ceph_monc_stop(&client->monc);
        ceph_osdc_stop(&client->osdc);
 
+       /*
+        * make sure mds and 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_adjust_min_caps(-client->min_caps);
 
        ceph_debugfs_client_cleanup(client);