]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: change the type of aio_t:res to long 21136/head
authorkungf <yang.wang@easystack.cn>
Fri, 30 Mar 2018 12:15:42 +0000 (20:15 +0800)
committerkungf <yang.wang@easystack.cn>
Fri, 30 Mar 2018 12:15:42 +0000 (20:15 +0800)
io_event::res was assigned to io_t::rval, but io_event::res
is long, if rval is int, this will cause overflow.

Fixes: http://tracker.ceph.com/issues/23527
Signed-off-by: kungf <yang.wang@easystack.cn>
src/os/bluestore/KernelDevice.cc
src/os/bluestore/aio.h

index 83e6bb5c70a52760b1237232e7b4ff6f86a4e687..9bae23ce5bf57d5c3a98ac89b725e8bc5a4163dc 100644 (file)
@@ -408,7 +408,7 @@ void KernelDevice::_aio_thread()
        // later flush() occurs.
        io_since_flush.store(true);
 
-       int r = aio[i]->get_return_value();
+       long r = aio[i]->get_return_value();
         if (r < 0) {
           derr << __func__ << " got " << cpp_strerror(r) << dendl;
           if (ioc->allow_eio && r == -EIO) {
index 1dc7413ed641feb3428b54efc37dd3a3ff6fb9d7..1c51ec4be6910f09fd2b1fe62640b3ba397a8342 100644 (file)
@@ -16,7 +16,7 @@ struct aio_t {
   int fd;
   boost::container::small_vector<iovec,4> iov;
   uint64_t offset, length;
-  int rval;
+  long rval;
   bufferlist bl;  ///< write payload (so that it remains stable for duration)
 
   boost::intrusive::list_member_hook<> queue_item;
@@ -37,7 +37,7 @@ struct aio_t {
     bl.append(std::move(p));
   }
 
-  int get_return_value() {
+  long get_return_value() {
     return rval;
   }
 };