From ffb6f78fd098425499ed15ddc4fbe09a41b9cf1c Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Wed, 19 Nov 2014 11:52:33 +0800 Subject: [PATCH] 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 --- src/os/KeyValueStore.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index d1b76c5859fa..2ed74b7b64f0 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; -- 2.47.3