]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: fix collection_list properly set next if end reached
authorMykola Golub <mgolub@suse.com>
Fri, 31 Jul 2020 15:05:10 +0000 (16:05 +0100)
committerMykola Golub <mgolub@suse.com>
Thu, 20 Aug 2020 15:17:30 +0000 (16:17 +0100)
Previously it was setting it to GMAX (happened when one had end
set to not GMAX and max set to INT_MAX).

Signed-off-by: Mykola Golub <mgolub@suse.com>
src/os/bluestore/BlueStore.cc

index 2220eb3d66d941f1b72374eb2ba5156bd66e15fd..e4549b0026fac625a45e91625df7ebfe6b747c0e 100644 (file)
@@ -10395,6 +10395,10 @@ int BlueStore::_collection_list(
        dout(20) << __func__ << " oid " << it->oid() << " >= " << pend << dendl;
       if (temp) {
        if (end.hobj.is_temp()) {
+          if (it->valid() && it->key() < temp_end_key) {
+            *pnext = it->oid();
+            set_next = true;
+          }
          break;
        }
        dout(30) << __func__ << " switch to non-temp namespace" << dendl;
@@ -10407,6 +10411,10 @@ int BlueStore::_collection_list(
        dout(30) << __func__ << " pend " << pend << dendl;
        continue;
       }
+      if (it->valid() && it->key() < end_key) {
+        *pnext = it->oid();
+        set_next = true;
+      }
       break;
     }
     dout(30) << __func__ << " key " << pretty_binary_string(it->key()) << dendl;