[Devel] [PATCH hci-8.2 v2 2/7] dm-qcow2: arm the ENOSPC timer only for the first delayed request

Alexander Ivanov alexander.ivanov at virtuozzo.com
Mon Nov 30 19:24:51 MSK 2026


Every delayed request rearms tgt->enospc_timer, so while new requests
keep failing the delayed ones are never retried. A guest that keeps
writing to a full disk is enough to postpone the retry indefinitely.

Arm the timer when the delay list turns non-empty, so the delayed
requests are retried a fixed period after the first of them failed.

https://virtuozzo.atlassian.net/browse/VSTOR-152175

Fixes: 6e2ec304689f ("dm-qcow2: Pause IO and notify about ENOSPC events")
Feature: dm-qcow2: block device over QCOW2 files driver
Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
---
 drivers/md/dm-qcow2-map.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 6be270e6c12c..0c4fe1ae767c 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -4697,10 +4697,10 @@ static bool qcow2_try_delay_enospc(struct qcow2_target *tgt, struct qcow2_rq *qr
 	pr_err_once(QCOW2_FMT("underlying disk is almost full"),
 			qcow2_device_name(tgt->ti));
 	tgt->event_enospc = true;
+	if (list_empty(&tgt->enospc_qios))
+		mod_timer(&tgt->enospc_timer, jiffies + ENOSPC_TIMEOUT_JI);
 	list_add_tail(&qio->link, &tgt->enospc_qios);
 unlock:
-	if (delayed)
-		mod_timer(&tgt->enospc_timer, jiffies + ENOSPC_TIMEOUT_JI);
 	schedule_work(&tgt->event_work);
 	spin_unlock_irqrestore(&tgt->event_lock, flags);
 
-- 
2.53.0



More information about the Devel mailing list