]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: include pool id in data block prefix if data pool enabled 11356/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 6 Oct 2016 19:40:56 +0000 (15:40 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 10 Oct 2016 18:08:09 +0000 (14:08 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/image/CreateRequest.cc

index 0e0d02bd9909961105193116fa2ba6a2b477cb6d..09aa17871a8daa2f49b52160034596dee7f22773 100644 (file)
@@ -387,11 +387,14 @@ Context *CreateRequest<I>::handle_add_image_to_directory(int *result) {
 template<typename I>
 void CreateRequest<I>::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);