From: kungf Date: Fri, 30 Mar 2018 12:15:42 +0000 (+0800) Subject: os/bluestore: change the type of aio_t:res to long X-Git-Tag: v13.1.0~432^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21136%2Fhead;p=ceph.git os/bluestore: change the type of aio_t:res to long 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 --- diff --git a/src/os/bluestore/KernelDevice.cc b/src/os/bluestore/KernelDevice.cc index 83e6bb5c70a5..9bae23ce5bf5 100644 --- a/src/os/bluestore/KernelDevice.cc +++ b/src/os/bluestore/KernelDevice.cc @@ -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) { diff --git a/src/os/bluestore/aio.h b/src/os/bluestore/aio.h index 1dc7413ed641..1c51ec4be691 100644 --- a/src/os/bluestore/aio.h +++ b/src/os/bluestore/aio.h @@ -16,7 +16,7 @@ struct aio_t { int fd; boost::container::small_vector 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; } };