]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: fix error path cleanup for opening an image
authorJosh Durgin <josh.durgin@inktank.com>
Mon, 11 Aug 2014 23:41:26 +0000 (16:41 -0700)
committerSage Weil <sage@redhat.com>
Tue, 12 Aug 2014 21:58:42 +0000 (14:58 -0700)
commitcbc9218edc122337fd6d9dbbdca18670e20c6169
treecb723629f859215008cbc7eb9202265627d1652a
parentb5dafe1c0f7ecf7c3a25d0be5dfddcbe3d07e69e
librbd: fix error path cleanup for opening an image

If the image doesn't exist and caching is enabled, the ObjectCacher
was not being shutdown, and the ImageCtx was leaked. The IoCtx could
later be closed while the ObjectCacher was still running, resulting in
a segfault. Simply use the usual cleanup path in open_image(), which
works fine here.

Fixes: #8912
Backport: dumpling, firefly
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 3dfa72d5b9a1f54934dc8289592556d30430959d)
src/librbd/internal.cc
src/test/pybind/test_rbd.py