All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.2] dm-qcow2: log the image, offset and ext_l2 word of an invalid entry
@ 2026-11-19 11:48 Denis V. Lunev
  2026-11-19 12:17 ` Konstantin Khorenko
  0 siblings, 1 reply; 2+ messages in thread
From: Denis V. Lunev @ 2026-11-19 11:48 UTC (permalink / raw)
  To: alexander.ivanov, vasileios.almpanis; +Cc: devel

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

parse_l2() reports an ext_l2 entry with allocated subclusters and no
cluster by l2->index_in_page and the page id. On ext_l2 images
index_in_page counts u64 words, two per entry, so the number it calls
the entry is twice the entry's index within the page. The ext_l2 word
that makes the entry invalid is not shown, nor is the image of a chain
the entry is in.

Print the image number as the table status does, the ext_l2 word with
both bitmaps, and the file offset of the entry, which can be looked up
in that image as is.

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

Feature: dm-qcow2: block device over QCOW2 files driver
Signed-off-by: Denis V. Lunev <den@openvz.org>
---

Applies on top of the series "dm-qcow2: fix the revert of a failed L2
writeback".

 drivers/md/dm-qcow2-map.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 89e569d09133..a44e41c512df 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -1980,9 +1980,11 @@ static loff_t parse_l2(struct qcow2 *qcow2, struct qcow2_map *map,
 		if (WARN_ON_ONCE(all_zeroes || (ext_l2 & (ext_l2 >> 32))))
 			goto out;
 		if (!pos && (u32)ext_l2) {
-			pr_err_ratelimited(QCOW2_FMT("invalid ext_l2 entry %u in page %llu"),
+			pr_err_ratelimited(QCOW2_FMT("img %u: ext_l2 %#llx at %#llx, no cluster"),
 					   qcow2_device_name(qcow2->tgt->ti),
-					   l2->index_in_page, l2->md->id);
+					   qcow2->img_id + 1, ext_l2,
+					   (l2->md->id << PAGE_SHIFT) +
+					   l2->index_in_page * sizeof(u64));
 			goto out;
 		}
 
-- 
2.55.0

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Devel] [PATCH hci-8.2] dm-qcow2: log the image, offset and ext_l2 word of an invalid entry
  2026-11-19 11:48 [Devel] [PATCH hci-8.2] dm-qcow2: log the image, offset and ext_l2 word of an invalid entry Denis V. Lunev
@ 2026-11-19 12:17 ` Konstantin Khorenko
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Khorenko @ 2026-11-19 12:17 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: devel

I won't apply this version, please send v2 with the changes below.

- Print qcow2->img_id as is (or the file with %pD), not img_id + 1.
- Say whose offset it is: the entry starts there, the ext_l2 word is
  8 bytes later.
- Keep "invalid" in the line.
- Drop "as the table status does" from the message.

On Thu, 19 Nov 2026 12:48:28 +0100, Denis V. Lunev wrote:
> +			pr_err_ratelimited(QCOW2_FMT("img %u: ext_l2 %#llx at %#llx, no cluster"),
> 					   qcow2_device_name(qcow2->tgt->ti),
> +					   qcow2->img_id + 1, ext_l2,

img_id is 0-based, and get_img_name, get_img_fd and
set_fault_injection take it as is. The table status prints img_id + 1
of the top image only, which is the number of images. So in a chain of
two an entry in the base image is logged as "img 1", and
"get_img_name 1" returns the top delta.

"ext_l2 %#llx at %#llx" reads as the offset of the ext_l2 word, while
the offset is of the L2 entry; parse_l2() reads ext_l2 from
index_in_page + 1. And an operator who got -EIO greps for "invalid".

As 4/4 of "dm-qcow2: fix the revert of a failed L2 writeback" is not
committed yet, I will fold v2 into it when applying that series.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-19 12:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 11:48 [Devel] [PATCH hci-8.2] dm-qcow2: log the image, offset and ext_l2 word of an invalid entry Denis V. Lunev
2026-11-19 12:17 ` Konstantin Khorenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.