From 7945f8d688f8f6f91fcc921fb6ab27c37efc71f8 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Mon, 12 Jan 2015 23:17:50 -0500 Subject: [PATCH] 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 --- src/librbd/internal.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 -- 2.47.3