]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: fix race during optracker switches between enabled/disabled mode 8330/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 28 Mar 2016 12:08:53 +0000 (20:08 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 28 Mar 2016 12:17:26 +0000 (20:17 +0800)
The RWLock lock is made private to protect tracking_enabled changing
but we are reading tracking_enabled beyond its protection during
unregister_inflight_op(). So this is a slight race conditon.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/TrackedOp.cc

index edea8476cb4aaa880b2bc48f18d9f5431c10f79b..2554c0921edd392a5a0fe98b6ea1f9dc163b62b6 100644 (file)
@@ -164,6 +164,7 @@ void OpTracker::unregister_inflight_op(TrackedOp *i)
   }
   i->_unregistered();
 
+  RWLock::RLocker l(lock);
   if (!tracking_enabled)
     delete i;
   else {