]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: fix crash using clone of flattened image
authorJosh Durgin <josh.durgin@inktank.com>
Thu, 24 Jul 2014 22:29:40 +0000 (15:29 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Mon, 15 Sep 2014 19:59:13 +0000 (12:59 -0700)
commita67f9152f128d693d160e5b08f2ac8b8bc83e8e0
tree90f853e3cdea8e1bddee97239ae9a71feb782648
parent2422f9fd634c239a1159c99aa4a49cfb5c5d097f
librbd: fix crash using clone of flattened image

The crash occurs due to ImageCtx->parent->parent being uninitialized,
since the inital open_parent() -> open_image(parent) ->
ictx_refresh(parent) occurs before ImageCtx->parent->snap_id is set,
so refresh_parent() is not called to open an ImageCtx for the parent
of the parent. This leaves the ImageCtx->parent->parent NULL, but the
rest of ImageCtx->parent updated to point at the correct parent snapshot.

Setting the parent->snap_id earlier has some unintended side effects
currently, so for now just call refresh_parent() during
open_parent(). This is the easily backportable version of the
fix. Further patches can clean up this whole initialization process.

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