Skip to content

Commit

Permalink
os/fs: fix aio submit method
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Sep 29, 2015
1 parent 04f9ae5 commit 566c872
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/os/fs/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class FS {
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) {
Expand All @@ -105,7 +105,8 @@ class FS {
return r;
}
assert(r == 1);
} while (false);
break;
}
return 0;
}

Expand Down

0 comments on commit 566c872

Please sign in to comment.