From 3fa09f02d7b9c16b1b2bd8e8ee09930e61c74a0d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 29 Dec 2015 09:45:47 -0500 Subject: [PATCH] os/bluestore: be tolerant of collection_list bounds 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 --- src/os/bluestore/BlueStore.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 7cf2ef9d2184a..373875bcda09b 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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 { -- 2.39.5