From: Haomai Wang Date: Wed, 19 Nov 2014 02:48:28 +0000 (+0800) Subject: KeyValueStore: Return -ENODATA if collection_getattr is nonexist X-Git-Tag: v0.90~65^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=877237f0962b9bc0cbfb7ceb536b47c4abe1b93c;p=ceph.git KeyValueStore: Return -ENODATA if collection_getattr is nonexist Signed-off-by: Haomai Wang --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 2ed74b7b64f0..505f06fee776 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -2268,12 +2268,16 @@ int KeyValueStore::collection_getattr(coll_t c, const char *name, r = -EINVAL; } - if (out.size()) + if (out.size()) { bl.swap(out.begin()->second); + r = bl.length(); + } else { + r = -ENODATA; + } dout(10) << __func__ << " " << c.to_str() << " '" << name << "' len " << bl.length() << " = " << r << dendl; - return bl.length(); + return r; } int KeyValueStore::collection_getattrs(coll_t cid,