From: hzwuhongsong Date: Tue, 29 Dec 2020 06:24:01 +0000 (+0800) Subject: blk: add upper bound of bluestore_deferred_batch_ops* options X-Git-Tag: v16.1.0~155^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38709%2Fhead;p=ceph.git blk: add upper bound of bluestore_deferred_batch_ops* options so the number of pending io does not overflow when being passed to submit_batch(). Signed-off-by: hzwuhongsong --- diff --git a/src/blk/kernel/KernelDevice.cc b/src/blk/kernel/KernelDevice.cc index e3ef9f155d8..d9327996597 100644 --- a/src/blk/kernel/KernelDevice.cc +++ b/src/blk/kernel/KernelDevice.cc @@ -12,6 +12,7 @@ * */ +#include #include #include #include @@ -813,6 +814,8 @@ void KernelDevice::aio_submit(IOContext *ioc) void *priv = static_cast(ioc); int r, retries = 0; + // num of pending aios should not overflow when passed to submit_batch() + assert(pending <= std::numeric_limits::max()); r = io_queue->submit_batch(ioc->running_aios.begin(), e, pending, priv, &retries); diff --git a/src/common/options.cc b/src/common/options.cc index 57901687e77..7590e0f8f13 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4617,17 +4617,20 @@ std::vector