From 5100f822d8795f613dc0626fa0a694eaf6dadaf6 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 11 May 2026 15:17:50 +0300 Subject: [PATCH] Wrap all submit_primary_xxx_subops waits with if (n_subops) > 0 --- src/osd/osd_primary.cpp | 7 +++++-- src/osd/osd_primary_sync.cpp | 7 +++++-- src/osd/osd_primary_write.cpp | 21 +++++++++++++++------ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/osd/osd_primary.cpp b/src/osd/osd_primary.cpp index e5c9784c..a6776611 100644 --- a/src/osd/osd_primary.cpp +++ b/src/osd/osd_primary.cpp @@ -769,8 +769,11 @@ resume_3: op_data->fact_ver++; submit_primary_del_subops(cur_op, NULL, 0, op_data->object_state ? op_data->object_state->osd_set : pg.cur_loc_set); resume_4: - op_data->st = 4; - return; + if (op_data->n_subops > 0) + { + op_data->st = 4; + return; + } resume_5: if (op_data->errors > 0) { diff --git a/src/osd/osd_primary_sync.cpp b/src/osd/osd_primary_sync.cpp index 3a8905f1..2c88baba 100644 --- a/src/osd/osd_primary_sync.cpp +++ b/src/osd/osd_primary_sync.cpp @@ -145,8 +145,11 @@ resume_4: // Stabilize version sets, if any submit_primary_stab_subops(cur_op); resume_5: - op_data->st = 5; - return; + if (op_data->n_subops > 0) + { + op_data->st = 5; + return; + } } resume_6: if (op_data->errors > 0) diff --git a/src/osd/osd_primary_write.cpp b/src/osd/osd_primary_write.cpp index 6e1bd1fe..68b8294c 100644 --- a/src/osd/osd_primary_write.cpp +++ b/src/osd/osd_primary_write.cpp @@ -231,8 +231,11 @@ resume_10: } submit_primary_subops(SUBMIT_WRITE, op_data->target_ver, pg.cur_set.data(), cur_op); resume_4: - op_data->st = 4; - return; + if (op_data->n_subops > 0) + { + op_data->st = 4; + return; + } resume_5: if (op_data->errors > 0) { @@ -247,8 +250,11 @@ resume_5: { submit_primary_rollback_subops(cur_op, pg.cur_set.data()); resume_11: - op_data->st = 11; - return; + if (op_data->n_subops > 0) + { + op_data->st = 11; + return; + } resume_12: // Ignore ROLLBACK errors - submit_primary_subops will drop the connection if it fails delete[] op_data->unstable_writes; @@ -487,8 +493,11 @@ immediate: } submit_primary_stab_subops(cur_op); resume_6: - op_data->st = 6; - return false; + if (op_data->n_subops > 0) + { + op_data->st = 6; + return false; + } resume_7: // FIXME: Free those in the destructor? delete op_data->unstable_write_osds;