]> git.apps.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:57:59 +0000 (14:57 -0700)
commite767254ce9a1610f3d640d8157fcb0d1fdf8edf2
treefead9ccefe992f87d15f2700596d8f3a398db7d7
parentdec028d113ab4bcc7106fea0bf413b54829f67e7
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