]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/fs: fix aio submit method 6101/head
authorSage Weil <sage@redhat.com>
Tue, 29 Sep 2015 01:31:23 +0000 (21:31 -0400)
committerSage Weil <sage@redhat.com>
Tue, 29 Sep 2015 01:31:23 +0000 (21:31 -0400)
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 <danny.al-gaaf@bisect.de>
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/fs/FS.h

index c6601635a061b3858e53d47eb0e82179f783184a..941fd1411b8fddb8985ed4916504fe9d0a095b50 100644 (file)
@@ -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;
     }