]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: avoid decrementing iterator before first element 51856/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:22:15 +0000 (13:22 +0000)
commita26da92ea61d390cd855f40b7ccaec04d5732f08
treeb7b6ad87826cebe39228454daeb90412392712bb
parent1a16f1a468f69ab46f59f8cc4cdbe7f2c1c1ca98
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