]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: be tolerant of collection_list bounds
authorSage Weil <sage@redhat.com>
Tue, 29 Dec 2015 14:45:47 +0000 (09:45 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:08:55 +0000 (13:08 -0500)
In particular, we may get a shard specified along with hobject_t min or
max (from PGBackend::objects_list_range()).

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 7cf2ef9d2184ad4eb107e9daf276bc66946d80dc..373875bcda09b3d0bb7bb9352e39aeb6270ac8fc 100644 (file)
@@ -2655,8 +2655,10 @@ int BlueStore::collection_list(
   if (!pnext)
     pnext = &static_next;
 
-  if (start == ghobject_t::get_max())
+  if (start == ghobject_t::get_max() ||
+      start.hobj == hobject_t::get_max()) {
     goto out;
+  }
   get_coll_key_range(cid, c->cnode.bits, &temp_start_key, &temp_end_key,
                     &start_key, &end_key);
   dout(20) << __func__
@@ -2666,7 +2668,9 @@ int BlueStore::collection_list(
           << " to " << pretty_binary_string(end_key)
           << " start " << start << dendl;
   it = db->get_iterator(PREFIX_OBJ);
-  if (start == ghobject_t() || start == cid.get_min_hobj()) {
+  if (start == ghobject_t() ||
+      start.hobj == hobject_t() ||
+      start == cid.get_min_hobj()) {
     it->upper_bound(temp_start_key);
     temp = true;
   } else {