From 79ebda933edbfdc26735f942de3c0c0739733644 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 28 Mar 2022 01:42:06 +0300 Subject: [PATCH] Fix a write hang with throttling due to timer reenterability / triggerability --- src/blockstore_write.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blockstore_write.cpp b/src/blockstore_write.cpp index 8915f422..916118dd 100644 --- a/src/blockstore_write.cpp +++ b/src/blockstore_write.cpp @@ -544,12 +544,13 @@ resume_4: if (ref_us > exec_us + throttle_threshold_us) { // Pause reply + PRIV(op)->op_state = 5; + // Remember that the timer can in theory be called right here tfd->set_timer_us(ref_us-exec_us, false, [this, op](int timer_id) { PRIV(op)->op_state++; ringloop->wakeup(); }); - PRIV(op)->op_state = 5; return 1; } }