]> git.apps.os.sepia.ceph.com Git - ceph.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>
Tue, 8 Sep 2020 17:50:14 +0000 (20:50 +0300)
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>
(cherry picked from commit 46d73a806c90b944c8596ad3d9dae3f5cf78d915)

src/os/bluestore/BlueStore.cc

index e0b617d6b6f35f96668e01f767bfb266f2378ba9..95c3c84d765d560749c525412c7c8ddc2e588942 100644 (file)
@@ -8369,6 +8369,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;
@@ -8381,6 +8385,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;