[Devel] [PATCH hci-8.1] drivers/md/dm-qcow2: set header_length to 72 for v2 images

Konstantin Khorenko khorenko at virtuozzo.com
Mon Nov 16 20:19:54 MSK 2026


Applying with these fixes on my side:
- subject prefix "drivers/md/dm-qcow2:" -> "dm-qcow2:", as in your
  sibling patch and most of the driver history
- added what the bug did: the walk ends on a zero word of the header,
  so v2 extensions were never seen
- added the new behaviour: a bitmaps extension in a v2 image is now
  checked as on v3, and a malformed one fails the table load, while
  qemu warns and ignores it
- added Fixes: f625cc9e0c22 ("dm-qcow2: parse bitmap extension"),
  which brought ext_start = hdr->header_length; 2a728299abdb, which
  Sashiko named, never read header_length for v2

On Mon, 16 Nov 2026 11:05:22 +0100, Alexander Ivanov wrote:
> Set header_length to the size of the v2 header before the version
> check, as qemu does. v3 images overwrite it from the raw header.

Bitmaps need the autoclear bit, which only v3 has, so a v2 image with
a bitmaps extension is not valid anyway. The stricter check is fine
with me, no code change needed.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list