]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlockDevice: check aio return values
authorSage Weil <sage@redhat.com>
Thu, 10 Dec 2015 21:49:14 +0000 (16:49 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:06:56 +0000 (13:06 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlockDevice.cc
src/os/fs/FS.h

index e73c2feffa33622c86a7196b8c3a2946bc60ff39..b3a9f35a67fb8da66e2b09e10d23197f60fd51fd 100644 (file)
@@ -172,8 +172,11 @@ void BlockDevice::_aio_thread()
        IOContext *ioc = static_cast<IOContext*>(aio[i]->priv);
        Mutex::Locker l(ioc->lock);
        --ioc->num_running;
-       dout(10) << __func__ << " finished aio " << aio[i] << " ioc " << ioc
+       int r = aio[i]->get_return_value();
+       dout(10) << __func__ << " finished aio " << aio[i] << " r " << r
+                << " ioc " << ioc
                 << " with " << ioc->num_running << " aios left" << dendl;
+       assert(r >= 0);
        _aio_finish(ioc, aio[i]->offset, aio[i]->length);
        if (ioc->num_running == 0) {
          ioc->running_bl.clear();
index a98952a45c1b75c0637b5b7b8b64ee73b5fac1da..02d3cafad3359eedebcd158b9045c42c6d19dded 100644 (file)
@@ -58,8 +58,9 @@ public:
     int fd;
     vector<iovec> iov;
     uint64_t offset, length;
+    int rval;
 
-    aio_t(void *p, int f) : priv(p), fd(f) {
+    aio_t(void *p, int f) : priv(p), fd(f), rval(-1000) {
       memset(&iocb, 0, sizeof(iocb));
     }
 
@@ -70,6 +71,10 @@ public:
       for (unsigned u=0; u<iov.size(); ++u)
        length += iov[u].iov_len;
     }
+
+    int get_return_value() {
+      return rval;
+    }
   };
 
   struct aio_queue_t {
@@ -127,6 +132,7 @@ public:
       }
       for (int i=0; i<r; ++i) {
        paio[i] = (aio_t *)event[i].obj;
+       paio[i]->rval = event[i].res;
       }
       return r;
     }