iotests/graph-changes-while-io: New test
commit971bea8089531af56b1bbd9ce62e756bdf006711
authorHanna Reitz <hreitz@redhat.com>
Wed, 16 Feb 2022 10:53:55 +0000 (16 11:53 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 4 Mar 2022 17:18:26 +0000 (4 18:18 +0100)
treea877a1ed3171fd079bc24e0a7a937c6b4dd84eda
parentec88eed8d14088b36a3495710368b8d1a3c33420
iotests/graph-changes-while-io: New test

Test the following scenario:
1. Some block node (null-co) attached to a user (here: NBD server) that
   performs I/O and keeps the node in an I/O thread
2. Repeatedly run blockdev-add/blockdev-del to add/remove an overlay
   to/from that node

Each blockdev-add triggers bdrv_refresh_limits(), and because
blockdev-add runs in the main thread, it does not stop the I/O requests.
I/O can thus happen while the limits are refreshed, and when such a
request sees a temporarily invalid block limit (e.g. alignment is 0),
this may easily crash qemu (or the storage daemon in this case).

The block layer needs to ensure that I/O requests to a node are paused
while that node's BlockLimits are refreshed.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20220216105355.30729-4-hreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/tests/graph-changes-while-io [new file with mode: 0755]
tests/qemu-iotests/tests/graph-changes-while-io.out [new file with mode: 0644]