From b03ac80a57cca602dd1eb834264d08006e70a737 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 7 May 2026 02:18:07 +0300 Subject: [PATCH] Fix missing error handling in chained read sec_read_bmp handling --- src/osd/osd_primary_chain.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osd/osd_primary_chain.cpp b/src/osd/osd_primary_chain.cpp index adb03200..e58429f7 100644 --- a/src/osd/osd_primary_chain.cpp +++ b/src/osd/osd_primary_chain.cpp @@ -82,6 +82,7 @@ int osd_t::read_bitmaps(osd_op_t *cur_op, pg_t *pg, int base_state) goto resume_0; else if (op_data->st == base_state+1) goto resume_1; + assert(op_data->st < base_state); if (!pg || pg->state == PG_ACTIVE && pg->scheme == POOL_SCHEME_REPLICATED) { // Happy path for clean replicated PGs (all bitmaps are available locally) @@ -112,6 +113,12 @@ resume_0: return 1; } resume_1: + if (op_data->errors > 0) + { + // Failure + finish_op(cur_op, op_data->errcode); + return -1; + } if (pg->scheme != POOL_SCHEME_REPLICATED) { for (int chain_num = 0; chain_num < op_data->chain_size; chain_num++) @@ -607,7 +614,7 @@ void osd_t::send_chained_read_results(pg_t *pg, osd_op_t *cur_op) { if (cur > prev) { - // Send buffer in parts to avoid copying + // Send buffer in parts to avoid copying if (!prev_set) { while ((cur-prev) > zero_buffer_size/bs_bitmap_granularity)