]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: bypass check if collection has more objects than nonexistent_count.
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 7 Nov 2017 14:17:14 +0000 (22:17 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Fri, 17 Nov 2017 10:16:00 +0000 (18:16 +0800)
If next != ghobject_t::get_max(), this mean collection has more data
than nonexistent_count. For this we should bypass check.
And fix wrong comments because _collection_list don't return object num.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc

index 66c5b29582a5045c9ca3303b8941cb871aadca1b..d786af3cb3a6778badd59cc9715ffb484bd77ba5 100644 (file)
@@ -11490,11 +11490,13 @@ int BlueStore::_remove_collection(TransContext *txc, const coll_t &cid,
     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);