]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
KeyValueStore: Return -ENODATA if collection_getattr is nonexist
authorHaomai Wang <haomaiwang@gmail.com>
Wed, 19 Nov 2014 02:48:28 +0000 (10:48 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Wed, 19 Nov 2014 03:53:12 +0000 (11:53 +0800)
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/os/KeyValueStore.cc

index 2ed74b7b64f01b75d922550712968c6f67a24bd3..505f06fee776cd062cec1a75c7a48888d4a96441 100644 (file)
@@ -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,