[Devel] [PATCH hci-8.2 v3 4/7] dm-ploop: arm the ENOSPC timer only for the first delayed request

Alexander Ivanov alexander.ivanov at virtuozzo.com
Tue Dec 1 11:50:06 MSK 2026


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

Arm the timer when llist_add() finds the delay list empty, so the
delayed requests are retried a fixed period after the first of them
failed.

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

Fixes: 90bb85536272 ("dm-ploop: Add ploop target driver")
Feature: dm-ploop: ploop target driver
Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>
---
 drivers/md/dm-ploop-map.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index a936de6377ef..45e73a8a6272 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -194,9 +194,8 @@ static bool ploop_try_delay_enospc(struct ploop_rq *prq, struct pio *pio)
 	pr_err_once(PL_FMT("underlying disk is almost full"),
 		ploop_device_name(ploop));
 	ploop->event_enospc = true;
-	llist_add((struct llist_node *)(&pio->list), &ploop->enospc_pios);
-
-	mod_timer(&ploop->enospc_timer, jiffies + PLOOP_ENOSPC_TIMEOUT);
+	if (llist_add((struct llist_node *)(&pio->list), &ploop->enospc_pios))
+		mod_timer(&ploop->enospc_timer, jiffies + PLOOP_ENOSPC_TIMEOUT);
 	schedule_work(&ploop->event_work);
 	spin_unlock_irqrestore(&ploop->deferred_lock, flags);
 
-- 
2.53.0



More information about the Devel mailing list