From: Haomai Wang Date: Wed, 19 Nov 2014 03:52:33 +0000 (+0800) Subject: KeyValueStore: Remove assert for collection_getattr method X-Git-Tag: v0.90~65^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ffb6f78fd098425499ed15ddc4fbe09a41b9cf1c;p=ceph.git KeyValueStore: Remove assert for collection_getattr method Merge 22b6c1a5317504e87042ffeff2b2d0d0b71cac5e introduce 5dc990c1ca821620993417ef4acc51a2b0a34606 commit which will lookup "remove" attr. It shouldn't exist for most of cases but KeyValueStore will crash if attr isn't exist. It seemed that this assert isn't correct. Signed-off-by: Haomai Wang --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index d1b76c5859fa1..2ed74b7b64f01 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -2268,8 +2268,8 @@ int KeyValueStore::collection_getattr(coll_t c, const char *name, r = -EINVAL; } - assert(out.size()); - bl.swap(out.begin()->second); + if (out.size()) + bl.swap(out.begin()->second); dout(10) << __func__ << " " << c.to_str() << " '" << name << "' len " << bl.length() << " = " << r << dendl;