Am 07.11.2025 um 13:31 hat Kevin Wolf geschrieben:
> Am 07.11.2025 um 10:18 hat Alberto Garcia geschrieben:
> > During a rebase operation data is copied from the backing chain into
> > the target image using a loop, and each iteration looks for a
> > contiguous region of allocated data of at most IO_BUF_SIZE (2 MB).
> > 
> > Once that region is found, and in order to avoid partial writes, its
> > boundaries are extended so they are aligned to the (sub)clusters of
> > the target image (see commit 12df580b).
> > 
> > This operation can however result in a region that exceeds the maximum
> > allowed IO_BUF_SIZE, crashing qemu-img.
> > 
> > This can be easily reproduced when the source image has a smaller
> > cluster size than the target image:
> > 
> > base <- int <- active
> > 
> > $ qemu-img create -f qcow2 base.qcow2 4M
> > $ qemu-img create -f qcow2 -F qcow2 -b base.qcow2 -o cluster_size=1M 
> > int.qcow2
> > $ qemu-img create -f qcow2 -F qcow2 -b int.qcow2  -o cluster_size=2M 
> > active.qcow2
> > $ qemu-io -c "write -P 0xff 1M 2M" int.qcow2
> > $ qemu-img rebase -F qcow2 -b base.qcow2 active.qcow2
> > qemu-img: qemu-img.c:4102: img_rebase: Assertion `written + pnum <= 
> > IO_BUF_SIZE' failed.
> > Aborted
> > 
> > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3174
> > Fixes: 12df580b3b7f ("qemu-img: rebase: avoid unnecessary COW operations")
> > Signed-off-by: Alberto Garcia <[email protected]>

Oops, I forgot to mention the other point I had:

Cc: qemu-stable <[email protected]>

Added it to the Cc: list of this reply and also to the commit message.

Kevin


Reply via email to