From: Ilya Dryomov Date: Tue, 11 Jun 2024 14:03:22 +0000 (+0200) Subject: librbd: assert on m_length in calc_object_diff_range() X-Git-Tag: v18.2.5~557^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7ebba9fcb121e844369f5bf8d1fc6b0ec0847654;p=ceph.git 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) --- diff --git a/src/librbd/api/DiffIterate.cc b/src/librbd/api/DiffIterate.cc index 717110bd38a13..9b400debd13a5 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);