From 566c8728b602a2da12bbd64ded02197c85dd1be4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 28 Sep 2015 21:31:23 -0400 Subject: [PATCH] os/fs: fix aio submit method continue in a do while(false) will always eval false and break out. To repeat, we need while (true) and an explicit break. Reported-by: Danny Al-Gaaf Signed-off-by: Sage Weil --- src/os/fs/FS.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/fs/FS.h b/src/os/fs/FS.h index c6601635a06..941fd1411b8 100644 --- a/src/os/fs/FS.h +++ b/src/os/fs/FS.h @@ -94,7 +94,7 @@ public: int submit(aio_t &aio, int *retries) { int attempts = 10; iocb *piocb = &aio.iocb; - do { + while (true) { int r = io_submit(ctx, 1, &piocb); if (r < 0) { if (r == -EAGAIN && attempts-- > 0) { @@ -105,7 +105,8 @@ public: return r; } assert(r == 1); - } while (false); + break; + } return 0; }