]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: avoid decrementing iterator before first element 51828/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 27 Apr 2023 12:44:51 +0000 (12:44 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Tue, 30 May 2023 09:56:03 +0000 (09:56 +0000)
commitca65e85575f7b35ce679309e92e0c9bee8d6b96a
treeb2135853a53da43198f8e241d9f8023020a1f8c2
parentd2205f5f8e13b7da2e2b40d5d68b372f49f6642b
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>
src/librbd/io/SimpleSchedulerObjectDispatch.cc