From: Jason Dillaman Date: Tue, 13 Jan 2015 04:17:50 +0000 (-0500) Subject: librbd: flush pending AIO requests under all existing flush scenarios X-Git-Tag: v0.92~20^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2697%2Fhead;p=ceph.git librbd: flush pending AIO requests under all existing flush scenarios AIO requests that are waiting on the image lock should be flushed during all existing RBD flush scenarios. A few flush cases were missed in the original implementation. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index e645fd883189..77af864c6731 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -3058,9 +3058,6 @@ reprotect_and_return_err: return r; } - if (ictx->image_watcher != NULL) { - ictx->image_watcher->flush_aio_operations(); - } ictx->user_flushed(); r = _flush(ictx); ictx->perfcounter->inc(l_librbd_flush); @@ -3069,6 +3066,10 @@ reprotect_and_return_err: int _flush(ImageCtx *ictx) { + if (ictx->image_watcher != NULL) { + ictx->image_watcher->flush_aio_operations(); + } + CephContext *cct = ictx->cct; int r; // flush any outstanding writes