block/rbd: fix write zeroes with growing images
commitcc5387a544325c26dcf124ac7d3999389c24e5c6
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 17 Mar 2022 16:26:38 +0000 (17 17:26 +0100)
committerHanna Reitz <hreitz@redhat.com>
Tue, 22 Mar 2022 08:40:54 +0000 (22 09:40 +0100)
tree658672ee11078a2a29437550f193439f31b75044
parent3213bbaf5797cc405e57f122e72c1fb55d0b08ab
block/rbd: fix write zeroes with growing images

Commit d24f80234b ("block/rbd: increase dynamically the image size")
added a workaround to support growing images (eg. qcow2), resizing
the image before write operations that exceed the current size.

We recently added support for write zeroes and without the
workaround we can have problems with qcow2.

So let's move the resize into qemu_rbd_start_co() and do it when
the command is RBD_AIO_WRITE or RBD_AIO_WRITE_ZEROES.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2020993
Fixes: c56ac27d2a ("block/rbd: add write zeroes support")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20220317162638.41192-1-sgarzare@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
block/rbd.c