From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v7 4/6] dm-qcow2: complete wbd before ending the data qio
Date: Thu, 22 Oct 2026 16:50:30 +0200 [thread overview]
Message-ID: <20261022145032.2128679-5-alexander.ivanov@virtuozzo.com> (raw)
In-Reply-To: <20261022145032.2128679-1-alexander.ivanov@virtuozzo.com>
data_rw_complete() calls qio_endio() before complete_wbd(). qio_endio()
drops the inflight ref, so qcow2_flush_deferred_activity() may return
on suspend while complete_wbd() for a failed L1/L2 writeback is still
running in AIO completion context. revert_l_entries_update() then
marks clusters unused and dirties R2 after the flush, and the change
is never written back.
Complete the wbd first. The md writeback path already does it in this
order.
https://virtuozzo.atlassian.net/browse/VSTOR-148171
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 810dd22425ae..ef832813b718 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -2884,13 +2884,14 @@ static void data_rw_complete(struct qio *qio)
spin_unlock_irqrestore(&qcow2->md_pages_lock, flags);
}
+ /* qio_endio() drops the inflight ref, which suspend waits for */
+ if (finalize_wbd)
+ complete_wbd(qcow2, wbd);
if (call_endio) {
if (bi_status != BLK_STS_OK)
qio->bi_status = bi_status;
qio_endio(qio);
}
- if (finalize_wbd)
- complete_wbd(qcow2, wbd);
}
static void perform_rw_mapped(struct qcow2_map *map, struct qio *qio)
--
2.53.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-10-22 14:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 14:50 [Devel] [PATCH hci-8.1 v7 0/6] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 1/6] dm-qcow2: add qcow2_md_page_read_sync() helper Alexander Ivanov
2026-10-22 14:55 ` no-reply
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 2/6] dm-qcow2: drop duplicate prefix from QC_ERR/QC_INFO messages Alexander Ivanov
2026-10-22 14:53 ` no-reply
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 3/6] dm-qcow2: extend the file in place_r2() before linking the refblock Alexander Ivanov
2026-10-22 14:56 ` no-reply
2026-10-26 10:52 ` Andrey Zhadchenko
2026-10-22 14:50 ` Alexander Ivanov [this message]
2026-10-22 14:58 ` [Devel] [PATCH hci-8.1 v7 4/6] dm-qcow2: complete wbd before ending the data qio no-reply
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 5/6] dm-qcow2: keep the dirty bit of an image opened dirty Alexander Ivanov
2026-10-22 14:58 ` no-reply
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 6/6] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-10-22 15:02 ` no-reply
2026-10-23 6:40 ` Alexander Ivanov
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=20261022145032.2128679-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