From df239f0f62fa324af7972594a333eeee66cc4a04 Mon Sep 17 00:00:00 2001 From: Xiaoxi Chen Date: Fri, 17 Apr 2015 16:14:41 +0800 Subject: [PATCH] os/Newstore:Fix collection_list_range We need to rule out hobject_t::max before calling get_object_key (in which will call get_filestore_key_u32 and get an assert failure) Signed-off-by: Xiaoxi Chen --- src/os/newstore/NewStore.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index 3ce09f3fff85..e137e5f3d022 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -1503,14 +1503,18 @@ int NewStore::collection_list( } it->upper_bound(k); } - get_object_key(end, &end_str); - if (end.hobj.is_temp()) { - if (temp) - pend = end_str.c_str(); - else - goto out; + if (end.hobj.is_max()) { + pend = temp ? temp_end_key.c_str() : end_key.c_str(); } else { - pend = temp ? temp_end_key.c_str() : end_str.c_str(); + get_object_key(end, &end_str); + if (end.hobj.is_temp()) { + if (temp) + pend = end_str.c_str(); + else + goto out; + } else { + pend = temp ? temp_end_key.c_str() : end_str.c_str(); + } } while (true) { if (!it->valid() || strcmp(it->key().c_str(), pend) > 0) { -- 2.47.3