Skip to content

Commit

Permalink
os/bluestore: fix empty check
Browse files Browse the repository at this point in the history
We want exists to be true if there is *any* old object that is not
in the onode_map or flagged as exists.  The previous code would only
tell us if the last-listed object was that way.

Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed May 2, 2019
1 parent fbebce6 commit 705d7d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -13320,12 +13320,12 @@ int BlueStore::_remove_collection(TransContext *txc, const coll_t &cid,
for (auto it = ls.begin(); !exists && it < ls.end(); ++it) {
dout(10) << __func__ << " oid " << *it << dendl;
auto onode = (*c)->onode_map.lookup(*it);
exists = !onode || onode->exists;
if (exists) {
if (!onode || onode->exists) {
dout(1) << __func__ << " " << *it
<< " exists in db, "
<< (!onode ? "not present in ram" : "present in ram")
<< dendl;
exists = true;
}
}
if (!exists) {
Expand Down

0 comments on commit 705d7d7

Please sign in to comment.