]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: avoid decrementing iterator before first element 51854/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 27 Apr 2023 12:44:51 +0000 (12:44 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 31 May 2023 13:21:05 +0000 (13:21 +0000)
commit64e2177100870c64a4f05eba0b6d6949cf8cd5e4
tree4f215151cd76fdd17a2a8cebc253ce2123e76461
parentdbba486cb438c73cc9096341faec84790a110686
librbd: avoid decrementing iterator before first element

While trying to merge delayed requests, SimpleSchedulerObjectDispatch
can end up iterating before the first element.

With llvm, this leads to a crash:
https://paste.opendev.org/raw/bxnQqqDtIrkOfVvRfkZ6/

This change adds a check, ensuring that we won't decrement the iterator
before the first map element.

Fixes: https://tracker.ceph.com/issues/61503
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit ca65e85575f7b35ce679309e92e0c9bee8d6b96a)
src/librbd/io/SimpleSchedulerObjectDispatch.cc