Skip to content

Commit

Permalink
ceph: close out mds, osd connections before stopping auth
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
liewegas committed May 29, 2010
1 parent dd1c905 commit a922d38
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions fs/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
1 change: 1 addition & 0 deletions fs/ceph/messenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 9 additions & 1 deletion fs/ceph/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a922d38

Please sign in to comment.