From a115062fa573a5f8d978a730074a1cd80083ff12 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 3 Nov 2016 14:14:23 -0400 Subject: [PATCH] os/bluestore: fix collection_list end bound off-by-one Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 78b06c3bbb3d0..b371b9212eccc 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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; -- 2.39.5