From: Sage Weil Date: Thu, 3 Nov 2016 18:14:23 +0000 (-0400) Subject: os/bluestore: fix collection_list end bound off-by-one X-Git-Tag: v11.1.0~418^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a115062fa573a5f8d978a730074a1cd80083ff12;p=ceph-ci.git os/bluestore: fix collection_list end bound off-by-one Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 78b06c3bbb3..b371b9212ec 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;