summaryrefslogtreecommitdiff
path: root/net/ceph/ceph_common.c
diff options
context:
space:
mode:
authorGuanjun He <gjhe@suse.com>2012-07-08 19:50:33 -0700
committerSage Weil <sage@inktank.com>2012-07-30 09:29:53 -0700
commita2a3258417eb6a1799cf893350771428875a8287 (patch)
treef8906aa980d79af72e7e02d5592512a914c4b721 /net/ceph/ceph_common.c
parenta16cb1f70799c851410d9dca0a24122e258df06c (diff)
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>
Diffstat (limited to 'net/ceph/ceph_common.c')
-rw-r--r--net/ceph/ceph_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 58b09efb528d..3b45e01fa8d1 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -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);