From 6679cadb070d9aa10d22ae9d4e63166191518fb0 Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Wed, 28 Feb 2024 18:33:46 +0100 Subject: [PATCH] os/bluestore: fix overlap function Signed-off-by: Pere Diaz Bou --- src/os/bluestore/BlueStore.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index d5c09f9a666e1..f4a9950cf6f89 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1861,7 +1861,8 @@ void BlueStore::BufferSpace::_dup_writing(TransContext* txc, Collection* collect for (auto it = writing.begin(); it != writing.end(); ++it) { Buffer& b = *it; // If no overlap is found between buffer and range to dup then continue - if (std::max(b.end(), offset+length) - std::min(b.offset, offset) > length + b.length) { + bool overlaps = offset < b.end() && end > b.offset; + if (!overlaps) { continue; } -- 2.39.5