]> git.proxmox.com Git - mirror_qemu.git/commit
block/file-posix: Truncate in xfs_write_zeroes()
authorMax Reitz <mreitz@redhat.com>
Fri, 10 May 2019 21:12:44 +0000 (23:12 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 20 May 2019 15:08:56 +0000 (17:08 +0200)
commit50ba5b2d994853b38fed10e0841b119da0f8b8e5
tree008c7fb1ae311f42c263d29d22a3abd1c7595100
parent6d8e75d41c58892ccc5d4ad61c4da476684c1c83
block/file-posix: Truncate in xfs_write_zeroes()

XFS_IOC_ZERO_RANGE does not increase the file length:
$ touch foo
$ xfs_io -c 'zero 0 65536' foo
$ stat -c "size=%s, blocks=%b" foo
size=0, blocks=128

We do want writes beyond the EOF to automatically increase the file
length, however.  This is evidenced by the fact that iotest 061 is
broken on XFS since qcow2's check implementation checks for blocks
beyond the EOF.

Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/file-posix.c