OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v2 1/2] dm-ploop: stop enospc_timer and event_work in ploop_destroy()
Date: Tue, 10 Nov 2026 20:00:32 +0100	[thread overview]
Message-ID: <20261110190033.2976967-2-den@openvz.org> (raw)
In-Reply-To: <20261110190033.2976967-1-den@openvz.org>

From: Denis V. Lunev <den@openvz.org>

The destructor never stops enospc_timer or event_work.
ploop_try_delay_enospc() arms the timer and queues the work after
testing wants_suspend, and nothing orders that against
timer_delete_sync_try() and flush_work() in ploop_presuspend(). A write
that fails with ENOSPC around the presuspend leaves the timer pending
and the work queued after the suspend. Once the device is removed, the
timer expires on the struct ploop that ploop_dtr() freed, and
do_ploop_event_work() reads ploop->ti from it.

Shut the timer down and cancel the work at the start of
ploop_destroy(). Both are set up before kt_worker is created, so they
are valid wherever ploop_destroy() finds kt_worker set.

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

Fixes: 6ddad5a4d226 ("dm-ploop: Add ploop target driver")
Feature: dm-ploop: ploop target driver
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 drivers/md/dm-ploop-target.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index d8279c79ef56..54b25fd0cb22 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -164,6 +164,8 @@ static void ploop_destroy(struct ploop *ploop)
 	int i;
 
 	if (ploop->kt_worker) {
+		timer_shutdown_sync(&ploop->enospc_timer);
+		cancel_work_sync(&ploop->event_work);
 		ploop->force_md_writeback = 1;
 		wake_up_process(ploop->kt_worker->task);
 		/* try to send all pending - if we have partial io and enospc end bellow */
-- 
2.53.0

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

  reply	other threads:[~2026-11-10 19:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 19:00 [Devel] [PATCH hci-8.1 v2 0/2] dm-ploop: fix writes held on ENOSPC never being retried Denis V. Lunev
2026-11-10 19:00 ` Denis V. Lunev [this message]
2026-11-10 19:05   ` [Devel] [PATCH hci-8.1 v2 1/2] dm-ploop: stop enospc_timer and event_work in ploop_destroy() no-reply
2026-11-12 12:50   ` Konstantin Khorenko
2026-11-10 19:00 ` [Devel] [PATCH hci-8.1 v2 2/2] dm-ploop: fix the ENOSPC retry timer not waking the dispatcher Denis V. Lunev
2026-11-10 19:02   ` no-reply
2026-11-12 12:50   ` Konstantin Khorenko
2026-11-12 12:50 ` [Devel] [PATCH hci-8.1 v2 0/2] dm-ploop: fix writes held on ENOSPC never being retried Konstantin Khorenko
2026-11-12 12:50 ` Konstantin Khorenko

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=20261110190033.2976967-2-den@openvz.org \
    --to=den@openvz.org \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    /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