From: Haomai Wang Date: Wed, 19 Nov 2014 04:02:43 +0000 (+0800) Subject: KeyValueStore: Fix collection_getattrs problem when zero-length attr X-Git-Tag: v0.90~65^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7a9b75577b102a0ddd3d0004091fc2ec1713fa96;p=ceph.git KeyValueStore: Fix collection_getattrs problem when zero-length attr Signed-off-by: Haomai Wang --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 505f06fee776c..3603c1e75f22b 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -2286,25 +2286,11 @@ int KeyValueStore::collection_getattrs(coll_t cid, dout(10) << __func__ << " " << cid.to_str() << dendl; map out; - set keys; - StripObjectMap::StripObjectHeaderRef header; - - for (map::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; }