ghobject_t next;
// Enumerate onodes in db, up to nonexistent_count + 1
// then check if all of them are marked as non-existent.
- // Bypass the check if returned number is greater than nonexistent_count
+ // Bypass the check if (next != ghobject_t::get_max())
r = _collection_list(c->get(), ghobject_t(), ghobject_t::get_max(),
nonexistent_count + 1, &ls, &next);
if (r >= 0) {
- bool exists = false; //ls.size() > nonexistent_count;
+ // If true mean collecton has more objects than nonexistent_count,
+ // so bypass check.
+ bool exists = (!next.is_max());
for (auto it = ls.begin(); !exists && it < ls.end(); ++it) {
dout(10) << __func__ << " oid " << *it << dendl;
auto onode = (*c)->onode_map.lookup(*it);