]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add sanity check against collection existence
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 4 Nov 2016 06:50:49 +0000 (14:50 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 5 Nov 2016 00:26:12 +0000 (08:26 +0800)
To keep pace with other methods.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index d7f3c9e35e3fff40ae5b51d59781c6e07d762557..5f4dd3535b794db7f9179e3cc9859f454684e0d2 100644 (file)
@@ -4965,10 +4965,10 @@ int BlueStore::set_collection_opts(
   if (!ch)
     return -ENOENT;
   Collection *c = static_cast<Collection*>(ch.get());
-  dout(15) << __func__ << " " << cid << " "
-    << " options " << opts << dendl;
+  dout(15) << __func__ << " " << cid << " options " << opts << dendl;
+  if (!c->exists)
+    return -ENOENT;
   RWLock::WLocker l(c->lock);
-
   c->pool_opts = opts;
   return 0;
 }