From 9275d50252d114e303101b31c1d9ea8be9b5f8b4 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Tue, 11 Jun 2024 16:03:22 +0200 Subject: [PATCH] librbd: assert on m_length in calc_object_diff_range() A non-empty byte range is required by both last_period_off calculation and Striper::file_to_extents(). Signed-off-by: Ilya Dryomov (cherry picked from commit 6b5f0088d799a72a840fae685b44b0f31eee6be8) --- src/librbd/api/DiffIterate.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librbd/api/DiffIterate.cc b/src/librbd/api/DiffIterate.cc index 75c4c56818fc..8d19542b3f3b 100644 --- a/src/librbd/api/DiffIterate.cc +++ b/src/librbd/api/DiffIterate.cc @@ -266,6 +266,7 @@ int DiffIterate::diff_iterate(I *ictx, template std::pair DiffIterate::calc_object_diff_range() { + ceph_assert(m_length > 0); uint64_t period = m_image_ctx.get_stripe_period(); uint64_t first_period_off = round_down_to(m_offset, period); uint64_t last_period_off = round_down_to(m_offset + m_length - 1, period); -- 2.47.3