Skip to content

Commit

Permalink
ceph: flush msgr_wq during mds_client shutdown
Browse files Browse the repository at this point in the history
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: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Mar 25, 2011
1 parent 59c2be1 commit ef550f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -3215,9 +3215,15 @@ void ceph_mdsc_destroy(struct ceph_fs_client *fsc)
{
struct ceph_mds_client *mdsc = fsc->mdsc;

dout("mdsc_destroy %p\n", mdsc);
ceph_mdsc_stop(mdsc);

/* flush out any connection work with references to us */
ceph_msgr_flush();

fsc->mdsc = NULL;
kfree(mdsc);
dout("mdsc_destroy %p done\n", mdsc);
}


Expand Down
4 changes: 2 additions & 2 deletions net/ceph/ceph_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ void ceph_destroy_client(struct ceph_client *client)
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'
* make sure osd connections close out before destroying the
* auth module, which is needed to free those connections'
* ceph_authorizers.
*/
ceph_msgr_flush();
Expand Down

0 comments on commit ef550f6

Please sign in to comment.