libceph: prevent the race of incoming work during teardown
Add an atomic variable 'stopping' as flag in struct ceph_messenger, set this flag to 1 in function ceph_destroy_client(), and add the condition code in function ceph_data_ready() to test the flag value, if true(1), just return. Signed-off-by: Guanjun He <gjhe@suse.com> Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
@@ -495,6 +495,8 @@ void ceph_destroy_client(struct ceph_client *client)
|
||||
{
|
||||
dout("destroy_client %p\n", client);
|
||||
|
||||
atomic_set(&client->msgr.stopping, 1);
|
||||
|
||||
/* unmount */
|
||||
ceph_osdc_stop(&client->osdc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user