From: xie xingguo Date: Fri, 5 Feb 2016 09:37:49 +0000 (+0800) Subject: os/kstore: fix race condition X-Git-Tag: v10.0.4~33^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5d5e4200e2f732f67215c2df2c18e9a4371ffceb;p=ceph.git os/kstore: fix race condition The get_omap_iterator shall check the existence of onode too, which may race with the rename method. Signed-off-by: xie xingguo --- diff --git a/src/os/kstore/KStore.cc b/src/os/kstore/KStore.cc index 50af01eaabbbc..934c702c26c4d 100644 --- a/src/os/kstore/KStore.cc +++ b/src/os/kstore/KStore.cc @@ -2134,7 +2134,7 @@ ObjectMap::ObjectMapIterator KStore::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" <