]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: fix collection_list end bound off-by-one
authorSage Weil <sage@redhat.com>
Thu, 3 Nov 2016 18:14:23 +0000 (14:14 -0400)
committerSage Weil <sage@redhat.com>
Thu, 3 Nov 2016 18:14:23 +0000 (14:14 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 78b06c3bbb3d04ab63d1a48d522cf651bd4bedeb..b371b9212ecccb7c26e329e3b6d0dc3147b12ebd 100644 (file)
@@ -5672,7 +5672,7 @@ int BlueStore::_collection_list(
   }
   dout(20) << __func__ << " pend " << pretty_binary_string(pend) << dendl;
   while (true) {
-    if (!it->valid() || it->key() > pend) {
+    if (!it->valid() || it->key() >= pend) {
       if (!it->valid())
        dout(20) << __func__ << " iterator not valid (end of db?)" << dendl;
       else
@@ -5691,7 +5691,7 @@ int BlueStore::_collection_list(
       }
       break;
     }
-    dout(20) << __func__ << " key " << pretty_binary_string(it->key()) << dendl;
+    dout(30) << __func__ << " key " << pretty_binary_string(it->key()) << dendl;
     if (is_extent_shard_key(it->key())) {
       it->next();
       continue;
@@ -5699,6 +5699,7 @@ int BlueStore::_collection_list(
     ghobject_t oid;
     int r = get_key_object(it->key(), &oid);
     assert(r == 0);
+    dout(20) << __func__ << " oid " << oid << " end " << end << dendl;
     if (ls->size() >= (unsigned)max) {
       dout(20) << __func__ << " reached max " << max << dendl;
       *pnext = oid;