]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: avoid decrementing iterator before first element 51855/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:43 +0000 (13:21 +0000)
commitfabca81423b5270f3143baa636079b5c40edfba2
tree72f5798a8262fc3e2444f7a23a831e2a20b14780
parentbfb61cbb813db4f12f84000a00ae9aa7629178c2
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