From: xie xingguo Date: Fri, 4 Nov 2016 06:50:49 +0000 (+0800) Subject: os/bluestore: add sanity check against collection existence X-Git-Tag: v11.1.0~404^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c96ecc521b46c7a4d6c4b25718ae62051708e176;p=ceph.git os/bluestore: add sanity check against collection existence To keep pace with other methods. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index d7f3c9e35e3f..5f4dd3535b79 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4965,10 +4965,10 @@ int BlueStore::set_collection_opts( if (!ch) return -ENOENT; Collection *c = static_cast(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; }