]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: protect list_children from invalid child pool IoCtxs 2980/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 18 Nov 2014 02:49:26 +0000 (21:49 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 18 Nov 2014 02:53:19 +0000 (21:53 -0500)
While listing child images, don't ignore error codes returned
from librados when creating an IoCtx. This will prevent seg
faults from occurring when an invalid IoCtx is used.

Fixes: #10123
Backport: giant, firefly, dumpling
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/internal.cc

index d88b3943539dbf0b351d0b49ede95e2b63de529e..d84361721c08233ac4f7cde9f7f0b3b85737af62 100644 (file)
@@ -429,7 +429,12 @@ namespace librbd {
        continue;
       }
       IoCtx ioctx;
-      rados.ioctx_create(it->c_str(), ioctx);
+      r = rados.ioctx_create(it->c_str(), ioctx);
+      if (r < 0) {
+        lderr(cct) << "Error accessing child image pool " << *it << dendl;
+        return r;
+      }
+
       set<string> image_ids;
       r = cls_client::get_children(&ioctx, RBD_CHILDREN,
                                       parent_spec, image_ids);