Commit ef550f6f authored by Sage Weil's avatar Sage Weil

ceph: flush msgr_wq during mds_client shutdown

The release method for mds connections uses a backpointer to the
mds_client, so we need to flush the workqueue of any pending work (and
ceph_connection references) prior to freeing the mds_client.  This fixes
an oops easily triggered under UML by

 while true ; do mount ... ; umount ... ; done

Also fix an outdated comment: the flush in ceph_destroy_client only flushes
OSD connections out.  This bug is basically an artifact of the ceph ->
ceph+libceph conversion.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 59c2be1e
...@@ -3215,9 +3215,15 @@ void ceph_mdsc_destroy(struct ceph_fs_client *fsc) ...@@ -3215,9 +3215,15 @@ void ceph_mdsc_destroy(struct ceph_fs_client *fsc)
{ {
struct ceph_mds_client *mdsc = fsc->mdsc; struct ceph_mds_client *mdsc = fsc->mdsc;
dout("mdsc_destroy %p\n", mdsc);
ceph_mdsc_stop(mdsc); ceph_mdsc_stop(mdsc);
/* flush out any connection work with references to us */
ceph_msgr_flush();
fsc->mdsc = NULL; fsc->mdsc = NULL;
kfree(mdsc); kfree(mdsc);
dout("mdsc_destroy %p done\n", mdsc);
} }
......
...@@ -394,8 +394,8 @@ void ceph_destroy_client(struct ceph_client *client) ...@@ -394,8 +394,8 @@ void ceph_destroy_client(struct ceph_client *client)
ceph_osdc_stop(&client->osdc); ceph_osdc_stop(&client->osdc);
/* /*
* make sure mds and osd connections close out before destroying * make sure osd connections close out before destroying the
* the auth module, which is needed to free those connections' * auth module, which is needed to free those connections'
* ceph_authorizers. * ceph_authorizers.
*/ */
ceph_msgr_flush(); ceph_msgr_flush();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment