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: v17.0.0~187^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e81400b8c287b5c5a61ddf946c188c2b9e66dd2f;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 e3ef9f155d80a..d932799659706 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 57901687e77f5..7590e0f8f13f8 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4617,17 +4617,20 @@ std::vector