]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: don't assert if parent pool doesn't exist
authorJason Dillaman <dillaman@redhat.com>
Thu, 10 May 2018 12:54:41 +0000 (08:54 -0400)
committerJason Dillaman <dillaman@redhat.com>
Sat, 19 May 2018 12:17:09 +0000 (08:17 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 88436b58bca5b271403f583f6b95e1d30ea81f8f)

src/librbd/image/RefreshParentRequest.cc

index f1c2d1cb564db28d09f8200bb95b7417277c25db..1b76efa11b7f4cf2e9b2ac05047326f008555856 100644 (file)
@@ -99,7 +99,11 @@ void RefreshParentRequest<I>::send_open_parent() {
 
   librados::IoCtx parent_io_ctx;
   int r = rados.ioctx_create2(m_parent_md.spec.pool_id, parent_io_ctx);
-  assert(r == 0);
+  if (r < 0) {
+    lderr(cct) << "failed to create IoCtx: " << cpp_strerror(r) << dendl;
+    send_complete(r);
+    return;
+  }
 
   // since we don't know the image and snapshot name, set their ids and
   // reset the snap_name and snap_exists fields after we read the header