mirror of
https://github.com/ceph/ceph
synced 2025-02-25 03:52:04 +00:00
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>
This commit is contained in:
parent
d2205f5f8e
commit
ca65e85575
@ -105,7 +105,8 @@ bool SimpleSchedulerObjectDispatch<I>::ObjectRequests::try_delay_request(
|
||||
|
||||
// try to merge back to an existing request
|
||||
iter = m_delayed_requests.lower_bound(object_off);
|
||||
if (iter == m_delayed_requests.end() || iter->first > object_off) {
|
||||
if (iter != m_delayed_requests.begin() &&
|
||||
(iter == m_delayed_requests.end() || iter->first > object_off)) {
|
||||
iter--;
|
||||
}
|
||||
if (iter != m_delayed_requests.end() &&
|
||||
|
Loading…
Reference in New Issue
Block a user