iotests/308: Add test for 'write -zu'
commit27e0d8b508068c16e8f846428eb1d4e70ae11218
authorHanna Czenczek <hreitz@redhat.com>
Mon, 27 Feb 2023 10:47:25 +0000 (27 11:47 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 10 Mar 2023 14:14:46 +0000 (10 15:14 +0100)
tree7b48c90da9dc6aaed43c7a4852ee07f96e9a0a9f
parent1703eb1c27a6010ff33d5add2d76aadc9b2777bd
iotests/308: Add test for 'write -zu'

Try writing zeroes to a FUSE export while allowing the area to be
unmapped; block/file-posix.c generally implements writing zeroes with
BDRV_REQ_MAY_UNMAP ('write -zu') by calling fallocate(PUNCH_HOLE).  This
used to lead to a blk_pdiscard() in the FUSE export, which may or may
not lead to the area being zeroed.  HEAD^ fixed this to use
blk_pwrite_zeroes() instead (again with BDRV_REQ_MAY_UNMAP), so verify
that running `qemu-io 'write -zu'` on a FUSE exports always results in
zeroes being written.

Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230227104725.33511-3-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/308
tests/qemu-iotests/308.out