From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v2 2/7] dm-qcow2: wait for L2 writeback in perform_rw_mapped()
Date: Tue, 10 Nov 2026 18:56:36 +0100 [thread overview]
Message-ID: <179433339615.3573054.6734068680199561725.b4-review@b4> (raw)
In-Reply-To: <20261110114629.416695-3-andrey.zhadchenko@virtuozzo.com>
I won't apply this version, please send v3 with the changes below.
On Tue, 10 Nov 2026 14:46:24 +0300, Andrey Zhadchenko wrote:
> + if (__delay_if_writeback(qcow2, md, index_in_page, &qio, false)) {
> + spin_unlock_irqrestore(&qcow2->md_pages_lock, flags);
> + return;
> + }
Item 1 of the cover letter reply: under this lock also check that the
L2 entry (and the ext_l2 word) is what parse_l2() saw and that the
index is not locked; if not, hand the qio back to main kwork.
Why: a failed L2 writeback can complete before the fast worker gets
here. complete_wbd() then reverts the entry and clears both
MD_WRITEBACK and md->wbd, so this code sees neither DIRTY nor
WRITEBACK. The write goes to X untracked and is acked, while X is no
longer mapped: the data is lost. In main kwork the write was attached
to the wbd in the same pass and got the error. The same recheck also
catches a discard that has already changed the entry (item 3).
> acked and flushed. If the L2 write fails instead, the entry is
> reverted and X freed while the write already returned success.
Item 1 of the cover letter reply: "X freed" becomes "X leaked".
Why: complete_wbd() clears FREE_ALLOCATED_CLU of the allocating qio,
so X stays allocated and unmapped. That wording came from my v1 reply,
sorry. Also, md->wbd is dropped in complete_wbd() from the fsync work,
not only by main kwork as the first paragraph says.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-10 17:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 11:46 [Devel] [PATCH hci-8.1 v2 0/7] dm-qcow2: per-qio fast path Andrey Zhadchenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 1/7] dm-qcow2: repeat md page lookup if it was inserted in parallel Andrey Zhadchenko
2026-11-10 11:55 ` no-reply
2026-11-10 17:56 ` Konstantin Khorenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 2/7] dm-qcow2: wait for L2 writeback in perform_rw_mapped() Andrey Zhadchenko
2026-11-10 11:56 ` no-reply
2026-11-10 17:56 ` Konstantin Khorenko [this message]
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 3/7] dm-qcow2: prepare process_one_qio() for fastpath Andrey Zhadchenko
2026-11-10 11:59 ` no-reply
2026-11-10 13:50 ` Andrey Zhadchenko
2026-11-10 17:56 ` Konstantin Khorenko
2026-11-11 14:36 ` Alexander Ivanov
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 4/7] dm-qcow2: add per-qio work infrastructure Andrey Zhadchenko
2026-11-10 12:02 ` no-reply
2026-11-11 15:34 ` Andrey Zhadchenko
2026-11-10 17:56 ` Konstantin Khorenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 5/7] dm-qcow2: implement per-qio fast processing Andrey Zhadchenko
2026-11-10 12:08 ` no-reply
2026-11-10 17:56 ` Konstantin Khorenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 6/7] dm-qcow2: process fast path qios in per-cpu batches on a workqueue Andrey Zhadchenko
2026-11-10 12:06 ` no-reply
2026-11-10 17:56 ` Konstantin Khorenko
2026-11-11 15:00 ` Alexander Ivanov
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 7/7] dm-qcow2: declare DM_TARGET_NOWAIT Andrey Zhadchenko
2026-11-10 12:06 ` no-reply
2026-11-10 17:56 ` [Devel] [PATCH hci-8.1 v2 0/7] dm-qcow2: per-qio fast path 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=179433339615.3573054.6734068680199561725.b4-review@b4 \
--to=khorenko@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