[Devel] [PATCH hci-8.1 v2 2/2] drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Fri Nov 13 11:37:07 MSK 2026


> Handle VIRTIO_BLK_T_WRITE_ZEROES for parity with virtio-blk. The range
> is zeroed with __blkdev_issue_zeroout(), which uses WRITE ZEROES of the
> backend or falls back to writing zero pages. The UNMAP flag maps to
> the absence of BLKDEV_ZERO_NOUNMAP. The range is issued in chunks of
> at most 16 WRITE ZEROES bios and 1 GiB, or 4 MiB ones when zero pages
> are written, since each chunk is built in the vhost worker.
> 
> The VMM must advertise blk_size equal to the backend logical block
> size, max_write_zeroes_sectors aligned to it and at most 8388607, and
> max_write_zeroes_seg = 1.
> 
> The guest gets VIRTIO_BLK_S_UNSUPP when VIRTIO_BLK_F_WRITE_ZEROES was
> not negotiated, for a payload other than exactly one segment or an
> unknown flag, and VIRTIO_BLK_S_IOERR for a read-only backend and for a
> range that is unaligned, beyond the capacity or above 8388607 sectors.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-141684
> Feature: vhost-blk: in-kernel accelerator for virtio-blk guests
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261113082744.2334476-1-alexander.ivanov@virtuozzo.com?part=2




More information about the Devel mailing list