qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/1] virtio-block: switch to blk_get_max_hw_transfer
@ 2021-12-09  9:28 Or Ozeri
  2021-12-09  9:28 ` [PATCH v1 1/1] " Or Ozeri
  0 siblings, 1 reply; 5+ messages in thread
From: Or Ozeri @ 2021-12-09  9:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: dupadhya, oro, to.my.trociny, qemu-block, dannyh

Since moving to qemu 6.1.0 we've been seeing disk failures inside a qemu guest VM.
This happened when using if=virtio on a host /dev/nbdX device.
Binary searching on qemu commit history, I found these errors start on this commit:

Commit 18473467
file-posix: try BLKSECTGET on block devices too, do not round to power of 2

The above commit switched posix block device limits (including host /dev/nbdX devices)
to query limits from /sys/dev/block/..., instead of using predefined limits.

The scsi-generic driver was changed to use the queried limits,
whereas the virtio-blk driver was only the queried max_iov,
but still using the predefined max_transfer, which is unlimited in qemu.

For NBD devices, max_iov is unlimited by the kernel nbd driver.
As as consequence, the virtio-blk merged requests over the limit of our host /dev/nbdX device,
which apparently caused the guest disk errors.

The solution that worked for me was to change the virtio-blk driver to use the max_transfer
limit queried from the posix host device (given by blk_get_max_hw_transfer).

Or Ozeri (1):
  virtio-block: switch to blk_get_max_hw_transfer

 hw/block/virtio-blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-30 11:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-09  9:28 [PATCH v1 0/1] virtio-block: switch to blk_get_max_hw_transfer Or Ozeri
2021-12-09  9:28 ` [PATCH v1 1/1] " Or Ozeri
2023-01-12 20:28   ` Ilya Dryomov
2023-01-13 11:44     ` Kevin Wolf
2023-01-30 10:48       ` Or Ozeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).