]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: change the type of aio_t:res to long 21231/head
authorkungf <yang.wang@easystack.cn>
Fri, 30 Mar 2018 12:15:42 +0000 (20:15 +0800)
committerPrashant D <pdhange@redhat.com>
Wed, 4 Apr 2018 02:54:50 +0000 (22:54 -0400)
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>
(cherry picked from commit a9b9477a44d4556f6827e6dc4b94a5f1f61ce8e1)

src/os/bluestore/KernelDevice.cc
src/os/bluestore/aio.h

index b3cc7795d9a92a790f7c738a4d0af8be29c257f9..ec4cc8bb0f844b2ea6cee09c3cc600bee855591b 100644 (file)
@@ -370,7 +370,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 2517e5f64fbbb3789b8847b7665dfab08a1aacf2..b2739d44cbe540ce875f8713feb73bbeb6d7782a 100644 (file)
@@ -19,7 +19,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;
@@ -40,7 +40,7 @@ struct aio_t {
     bl.append(std::move(p));
   }
 
-  int get_return_value() {
+  long get_return_value() {
     return rval;
   }
 };