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
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-26 11:38:38 -0800
commit59d02721bb2838893596d5617659fe907dd45518 (patch)
tree126ac6b7dba3ef26cb4c6e32b7bc2faf74c1c35d /net/ceph/ceph_common.c
parent9beb73fcb83317786226b4203d7e56c6b0f43adb (diff)
libceph: prevent the race of incoming work during teardown
(cherry picked from commit a2a3258417eb6a1799cf893350771428875a8287) 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 c815f31a1a3f..52fe52cde606 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);