]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix race condition
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 5 Feb 2016 09:34:51 +0000 (17:34 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 5 Feb 2016 09:34:51 +0000 (17:34 +0800)
The get_omap_iterator shall check the existence of onode too, which may
race with the rename method.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index ab4c7d96b93ef26380de8adc508b4c642b751d16..31d64c6ed4e3605490b5686f17fd26b82f9b9606 100644 (file)
@@ -3396,7 +3396,7 @@ ObjectMap::ObjectMapIterator BlueStore::get_omap_iterator(
   }
   RWLock::RLocker l(c->lock);
   OnodeRef o = c->get_onode(oid, false);
-  if (!o) {
+  if (!o || !o->exists) {
     dout(10) << __func__ << " " << oid << "doesn't exist" <<dendl;
     return ObjectMap::ObjectMapIterator();
   }