OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v2 4/9] drivers/md/dm-qcow2: arm the hold timer only for the first held request
Date: Tue, 17 Nov 2026 11:10:21 +0100	[thread overview]
Message-ID: <20261117101026.3071579-5-alexander.ivanov@virtuozzo.com> (raw)
In-Reply-To: <20261117101026.3071579-1-alexander.ivanov@virtuozzo.com>

Every held request rearms tgt->held_timer, so while new requests keep
failing the held 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 held list turns non-empty, so the held 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@virtuozzo.com>
---
 drivers/md/dm-qcow2-map.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index b987d459863d..d6f8bcd98a39 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -4569,7 +4569,7 @@ void do_qcow2_fsync_work(struct work_struct *ws)
 static bool qcow2_try_hold_error(struct qcow2_target *tgt, struct qcow2_rq *qrq,
 				 struct qio *qio, blk_status_t bi_status)
 {
-	bool held = true;
+	bool held = true, first = false;
 	unsigned long flags;
 
 	if (bi_status != BLK_STS_NOSPC)
@@ -4586,11 +4586,12 @@ static bool qcow2_try_hold_error(struct qcow2_target *tgt, struct qcow2_rq *qrq,
 	pr_err_once(QCOW2_FMT("underlying disk is almost full"),
 			qcow2_device_name(tgt->ti));
 	tgt->event_enospc = true;
+	first = list_empty(&tgt->held_qios);
 	list_add_tail(&qio->link, &tgt->held_qios);
 unlock:
 	spin_unlock_irqrestore(&tgt->event_lock, flags);
 
-	if (held)
+	if (first)
 		mod_timer(&tgt->held_timer, jiffies + HOLD_TIMEOUT_JI);
 	schedule_work(&tgt->event_work);
 
-- 
2.53.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-11-17 10:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 10:10 [Devel] [PATCH hci-8.1 v2 0/9] dm-qcow2: support the werror/rerror policies for vhost-blk disks Alexander Ivanov
2026-11-17 10:10 ` [Devel] [PATCH hci-8.1 v2 1/9] drivers/md/dm-qcow2: cancel the event work and ENOSPC timer in the destructor Alexander Ivanov
2026-11-17 10:22   ` no-reply
2026-11-17 10:10 ` [Devel] [PATCH hci-8.1 v2 2/9] drivers/md/dm-qcow2: always resubmit delayed ENOSPC requests in presuspend Alexander Ivanov
2026-11-17 10:25   ` no-reply
2026-11-17 10:10 ` [Devel] [PATCH hci-8.1 v2 3/9] drivers/md/dm-qcow2: rename the ENOSPC delay list to a held request list Alexander Ivanov
2026-11-17 10:25   ` no-reply
2026-11-17 10:10 ` Alexander Ivanov [this message]
2026-11-17 10:27   ` [Devel] [PATCH hci-8.1 v2 4/9] drivers/md/dm-qcow2: arm the hold timer only for the first held request no-reply
2026-11-17 10:10 ` [Devel] [PATCH hci-8.1 v2 5/9] drivers/md/dm-qcow2: report held requests with an IO_ERROR uevent Alexander Ivanov
2026-11-17 10:29   ` no-reply
2026-11-17 10:10 ` [Devel] [PATCH hci-8.1 v2 6/9] drivers/md/dm-qcow2: add the resubmit and fail_held messages Alexander Ivanov
2026-11-17 10:32   ` no-reply
2026-11-17 10:10 ` [Devel] [PATCH hci-8.1 v2 7/9] drivers/md/dm-qcow2: add the error_policy table argument Alexander Ivanov
2026-11-17 10:34   ` no-reply
2026-11-17 10:10 ` [Devel] [PATCH hci-8.1 v2 8/9] drivers/md/dm-qcow2: requeue held requests on a noflush suspend Alexander Ivanov
2026-11-17 10:37   ` no-reply
2026-11-17 10:10 ` [Devel] [PATCH hci-8.1 v2 9/9] drivers/vhost/blk: fix a hang on release after the vhost worker is killed Alexander Ivanov
2026-11-17 10:42   ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261117101026.3071579-5-alexander.ivanov@virtuozzo.com \
    --to=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox