From: Xiaoxi Chen Date: Fri, 17 Apr 2015 08:14:41 +0000 (+0800) Subject: os/Newstore:Fix collection_list_range X-Git-Tag: v9.1.0~242^2~37 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=df239f0f62fa324af7972594a333eeee66cc4a04;p=ceph.git 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 --- 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) {