summary refs log tree commit diff stats
path: root/hw/misc/aspeed_hace.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2025-04-17 17:10:53 -0400
committerKevin Wolf <kwolf@redhat.com>2025-05-22 16:54:10 +0200
commit5634622bcb339f213469eceeff005640492fc902 (patch)
tree7c98c57894653428c5fc72b649f41e64738f8331 /hw/misc/aspeed_hace.c
parentff2ab634e4bb3bddcf5f5ee29e0b46f71e3f4b54 (diff)
downloadfocaccia-qemu-5634622bcb339f213469eceeff005640492fc902.tar.gz
focaccia-qemu-5634622bcb339f213469eceeff005640492fc902.zip
file-posix: allow BLKZEROOUT with -t writeback
The Linux BLKZEROOUT ioctl is only invoked when BDRV_O_NOCACHE is set
because old kernels did not invalidate the page cache. In that case
mixing BLKZEROOUT with buffered I/O could lead to corruption.

However, Linux 4.9 commit 22dd6d356628 ("block: invalidate the page
cache when issuing BLKZEROOUT") made BLKZEROOUT coherent with the page
cache.

I have checked that Linux 4.9+ kernels are shipped at least as far back
as Debian 10 (buster), openSUSE Leap 15.2, and RHEL/CentOS 8.

Use BLKZEROOUT with buffered I/O, mostly so `qemu-img ... -t
writeback` can offload write zeroes.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20250417211053.98700-1-stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/misc/aspeed_hace.c')
0 files changed, 0 insertions, 0 deletions