OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 4/4] dm-ploop: fix a failed cluster copy on grow leaving the BAT page busy
Date: Tue,  3 Nov 2026 09:36:42 +0100	[thread overview]
Message-ID: <20261103083642.130885-5-den@openvz.org> (raw)
In-Reply-To: <20261103083642.130885-1-den@openvz.org>

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

ploop_prepare_reloc_index_wb() marks the BAT page of a relocated
cluster MD_UPDATING and MD_DIRTY and allocates the cluster to copy it
to. When ploop_write_cluster_sync() then fails, an I/O error or ENOSPC
on the host file system, ploop_grow_relocate_cluster() only frees the
piwb. The resize fails and submission resumes with both bits set:

- every allocating write, discard or COW on a cluster of that page is
  parked in md->wait_llist, which only a writeback completion of the
  page drains, and none comes. These requests never complete, a dm
  suspend of the device hangs and later ploop cmds time out in the
  inflight ref switch;

- the allocated cluster stays taken in holes_bitmap until the image is
  reopened.

Clear the bits as the error path of ploop_prepare_reloc_index_wb()
does and give the cluster back. Submission is stopped for the whole
resize, so no pio waits on the page and none has to be resubmitted.

Fixes: 018063db0eeb ("dm-ploop: fix resize and grow to use the new way of updating md pages")
Reported-by: Konstantin Khorenko <khorenko@virtuozzo.com>
https://virtuozzo.atlassian.net/browse/VSTOR-152981
Feature: dm-ploop: ploop target driver
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 drivers/md/dm-ploop-cmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 72a9662d2bdb..54458316673e 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -351,6 +351,12 @@ static int ploop_grow_relocate_cluster(struct ploop *ploop,
 		PL_ERR("reloc: failed write: %d", ret);
 		/* piwb can not change here we are the only user of md page */
 		ploop_break_bat_update(ploop, md, piwb);
+		spin_lock_irq(&ploop->bat_lock);
+		if (add_for_wb)
+			clear_bit(MD_DIRTY, &md->status);
+		clear_bit(MD_UPDATING, &md->status);
+		ploop_hole_set_bit(new_dst, ploop);
+		spin_unlock_irq(&ploop->bat_lock);
 		goto out;
 	}
 
-- 
2.53.0

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

  parent reply	other threads:[~2026-11-03  8:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  8:36 [Devel] [PATCH hci-8.1 0/4] dm-ploop: fix the pio submission stop around cmds Denis V. Lunev
2026-11-03  8:36 ` [Devel] [PATCH hci-8.1 1/4] dm-ploop: fix pio submission racing with the suspend and resume of a cmd Denis V. Lunev
2026-11-03  8:40   ` no-reply
2026-11-04 17:14   ` Konstantin Khorenko
2026-11-03  8:36 ` [Devel] [PATCH hci-8.1 2/4] dm-ploop: fix a lost wakeup of the ploop_allocator() thread Denis V. Lunev
2026-11-03  8:39   ` no-reply
2026-11-04 17:14   ` Konstantin Khorenko
2026-11-03  8:36 ` [Devel] [PATCH hci-8.1 3/4] dm-ploop: wait for the ploop_allocator() thread before changing deltas[] Denis V. Lunev
2026-11-03  8:42   ` no-reply
2026-11-04 17:14   ` Konstantin Khorenko
2026-11-03  8:36 ` Denis V. Lunev [this message]
2026-11-03  8:42   ` [Devel] [PATCH hci-8.1 4/4] dm-ploop: fix a failed cluster copy on grow leaving the BAT page busy no-reply
2026-11-04 17:14   ` Konstantin Khorenko
2026-11-04 13:24 ` [Devel] [PATCH hci-8.1 0/4] dm-ploop: fix the pio submission stop around cmds Andrey Zhadchenko
2026-11-04 17:14 ` 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=20261103083642.130885-5-den@openvz.org \
    --to=den@openvz.org \
    --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