From: Mykola Golub Date: Fri, 31 Jul 2020 15:05:10 +0000 (+0100) Subject: os/bluestore: fix collection_list properly set next if end reached X-Git-Tag: v15.2.9~122^2~43^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08e1f3fec9026bb5a2284655001521892877b2e0;p=ceph.git os/bluestore: fix collection_list properly set next if end reached 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 (cherry picked from commit 46d73a806c90b944c8596ad3d9dae3f5cf78d915) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 97e83ee6076..abad813b032 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -10691,6 +10691,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; @@ -10703,6 +10707,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;