> req->len covered the whole descriptor chain, so both readable and > writable data buffers became the payload. A read wrote disk data into > device-readable buffers and reported them as used, a write sent the > guest's writable buffers to disk. > > Take write data only from the readable part and the payload of other > requests only from the writable part, as QEMU does. Read the status > byte from the end of the writable part. > > Complete a read or write with VIRTIO_BLK_S_IOERR if its payload is > empty, above ALIGN_DOWN(INT_MAX, SECTOR_SIZE) or, for a write, not a > multiple of SECTOR_SIZE. An empty payload used to fail in bio setup > and an unaligned write hit a WARN_ONCE() reachable from the guest. > In both cases the kick handler broke out with the descriptor consumed > and notifications disabled, so the virtqueue stalled. Drop the > WARN_ONCE(). > > The size bound is new for writes: the readable side had no limit and > a write of any size was submitted. Reads above INT_MAX still get > -EINVAL from the in_len check, the bound only covers the range below > it. > > https://virtuozzo.atlassian.net/browse/VSTOR-142755 > Fixes: 1629db092dd7 ("drivers/vhost: vhost-blk accelerator for virtio-blk > guests") > Fixes: 02ce37f62707 ("vhost-blk: add bounce-buffer for non-aligned requests") > Feature: vhost-blk: in-kernel accelerator for virtio-blk guests > Signed-off-by: Alexander Ivanov <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.vzint.dev/#/patchset/[email protected]?part=3 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
