Skip to content

Commit 6b5f008

Browse files
committed
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 <[email protected]>
1 parent 6db8780 commit 6b5f008

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librbd/api/DiffIterate.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ int DiffIterate<I>::diff_iterate(I *ictx,
266266

267267
template <typename I>
268268
std::pair<uint64_t, uint64_t> DiffIterate<I>::calc_object_diff_range() {
269+
ceph_assert(m_length > 0);
269270
uint64_t period = m_image_ctx.get_stripe_period();
270271
uint64_t first_period_off = round_down_to(m_offset, period);
271272
uint64_t last_period_off = round_down_to(m_offset + m_length - 1, period);

0 commit comments

Comments
 (0)