From: Jason Dillaman Date: Tue, 18 Nov 2014 02:49:26 +0000 (-0500) Subject: librbd: protect list_children from invalid child pool IoCtxs X-Git-Tag: v0.90~52^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0d350b6817d7905908a4e432cd359ca1d36bab50;p=ceph.git librbd: protect list_children from invalid child pool IoCtxs 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 --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index d88b3943539d..d84361721c08 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -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 image_ids; r = cls_client::get_children(&ioctx, RBD_CHILDREN, parent_spec, image_ids);