From: Jason Dillaman Date: Thu, 6 Oct 2016 19:40:56 +0000 (-0400) Subject: librbd: include pool id in data block prefix if data pool enabled X-Git-Tag: v11.1.0~675^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3b81f6871917b282b50d3ac412ffb69b6e66d074;p=ceph.git librbd: include pool id in data block prefix if data pool enabled Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/image/CreateRequest.cc b/src/librbd/image/CreateRequest.cc index 0e0d02bd99099..09aa17871a8da 100644 --- a/src/librbd/image/CreateRequest.cc +++ b/src/librbd/image/CreateRequest.cc @@ -387,11 +387,14 @@ Context *CreateRequest::handle_add_image_to_directory(int *result) { template void CreateRequest::create_image() { ldout(m_cct, 20) << this << " " << __func__ << dendl; + assert(m_data_pool.empty() || m_data_pool_id != -1); ostringstream oss; - oss << RBD_DATA_PREFIX << m_image_id; - - assert(m_data_pool.empty() || m_data_pool_id != -1); + oss << RBD_DATA_PREFIX; + if (m_data_pool_id != -1) { + oss << stringify(m_ioctx.get_id()) << "."; + } + oss << m_image_id; librados::ObjectWriteOperation op; op.create(true);