]> 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>
Thu, 24 Jul 2014 23:15:20 +0000 (16:15 -0700)
commit2545e80d274b23b6715f4d8b1f4c6b96182996fb
tree43f39b2f3a89ebb5d9b8c09a2e4a213eea067d0a
parent29401c7e779ad071e0dde7c2a9600fa470370d9a
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>
src/librbd/internal.cc
src/librbd/internal.h
src/test/pybind/test_rbd.py