]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
KeyValueStore: Fix collection_getattrs problem when zero-length attr
authorHaomai Wang <haomaiwang@gmail.com>
Wed, 19 Nov 2014 04:02:43 +0000 (12:02 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Wed, 19 Nov 2014 05:11:23 +0000 (13:11 +0800)
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/os/KeyValueStore.cc

index 505f06fee776cd062cec1a75c7a48888d4a96441..3603c1e75f22b2fd10f20bbac96ecf304037167d 100644 (file)
@@ -2286,25 +2286,11 @@ int KeyValueStore::collection_getattrs(coll_t cid,
   dout(10) << __func__ << " " << cid.to_str() << dendl;
 
   map<string, bufferlist> out;
-  set<string> keys;
-  StripObjectMap::StripObjectHeaderRef header;
-
-  for (map<string, bufferptr>::iterator it = aset.begin();
-       it != aset.end(); ++it) {
-      keys.insert(it->first);
-  }
-
-  int r = backend->lookup_strip_header(get_coll_for_coll(),
-                                       make_ghobject_for_coll(cid), &header);
-  if (r < 0) {
-    dout(10) << __func__ << " lookup_strip_header failed: r =" << r << dendl;
-    return r;
-  }
 
-  r = backend->get_values_with_header(header, COLLECTION_ATTR, keys, &out);
+  int r = backend->get(get_coll_for_coll(), make_ghobject_for_coll(cid),
+                       COLLECTION_ATTR, &out);
   if (r < 0) {
     dout(10) << __func__ << " could not get keys" << dendl;
-    r = -EINVAL;
     goto out;
   }