[Devel] [PATCH hci-8.1 3/7] drivers/md/dm-qcow2: prepare process_one_qio() for fastpath
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Nov 5 00:35:09 MSK 2026
I won't apply this version, please send v2 with the changes below.
On Thu, 29 Oct 2026 17:03:42 +0300, Andrey Zhadchenko wrote:
> static int handle_metadata(struct qcow2 *qcow2, struct qio **qio,
> - struct qcow2_map *map)
> + struct qcow2_map *map, bool avoid_metadata_changes)
> {
> bool write = op_is_write((*qio)->bi_op);
> int ret;
Item 2 of the cover letter reply: pass the flag into parse_metadata()
and return to the slow path before qcow2_handle_r1r2_maps().
Why: for COW writes and cluster unmapping discards parse_metadata()
looks up the R1 and R2 pages before this function decides to go slow,
so the fast path reads them for nothing. The comment above
__handle_r1r2_maps() says R1 is unstable outside the main kwork. If the
R1 page is not cached, submit_read_md_page() drops the lock and inserts
it under the old page id; when relocate_refcount_table() has renumbered
the cached R1 pages meanwhile, a stale copy of the old R1 cluster stays
in the cache under an id whose cluster relocate then frees.
Alexander's remarks on the typo and on the literal 2 still need an
answer (item 7).
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list