]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/Newstore:Fix collection_list_range
authorXiaoxi Chen <xiaoxi.chen@intel.com>
Fri, 17 Apr 2015 08:14:41 +0000 (16:14 +0800)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:41 +0000 (13:39 -0400)
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 <xiaoxi.chen@intel.com>
src/os/newstore/NewStore.cc

index 3ce09f3fff85648563e4771bebabd8698b25665e..e137e5f3d022d2bb9e10e44223154653e1170ba3 100644 (file)
@@ -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) {