]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: handle parent change while async I/Os are in flight
authorDan Mick <dan.mick@inktank.com>
Sat, 1 Dec 2012 02:11:09 +0000 (18:11 -0800)
committerDan Mick <dan.mick@inktank.com>
Thu, 6 Dec 2012 01:05:18 +0000 (17:05 -0800)
commit41e16a3b40efb80a5ed7a5587438569ca86c85a3
treeb0b5d4806d685000259df40b109e58fe172c3e20
parent917a6f296323164f9d79df94916932722e66fc0a
librbd: handle parent change while async I/Os are in flight

During a test_librbd_fsx run including flatten, ImageCtx->parent
was being dereferenced while null.  Between the time the parent
overlap is calculated and the time the guard+write completes
with ENOENT and submits the copyup+write, the parent image
could have changed (by resize) or been made irrelevant (by
child flatten) such that the parent overlap is now incorrect.

Handle "no parent" by just sending the copyup+write; the copyup
part will be a no-op.  Move to WRITE_FLAT state in this case
because there's no more child to deal with.

Handle "overlap changed" by recalculating overlap before
reading parent data; if none is left, don't read, but rather
just clear m_object_image_extents, in which case the copyup
will again be a no-op because it will be of zero length.
However we still have a parent, so stay in WRITE_COPYUP state
and come back through as usual.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Fixes: #3524
src/librbd/AioRequest.cc