I won't apply this version, please send v4 with the changes below. 1. Patch 2: take the shape Andrey asked for in his reply to 2/2: one REQ_OP_WRITE_ZEROES bio per request, no zero-page fallback, no chunks, no vhost_blk_retry_zeroes(). 2. Patch 2: keep the request checks: the feature negotiated, exactly one segment, known flags only, alignment to the logical block size, a read-only backend, the range inside the device. 3. Patch 2: keep the cap at UINT_MAX >> SECTOR_SHIFT and also reject a range above bdev_write_zeroes_sectors() with VIRTIO_BLK_S_IOERR. 4. Patch 2: a backend without WRITE ZEROES (limit 0) gets VIRTIO_BLK_S_IOERR, not a fallback. 5. Patch 2 message: say that the VMM advertises the feature only for a backend with WRITE ZEROES and sets max_write_zeroes_sectors from it. 6. Patch 1 stays as it is.
On Tue, 17 Nov 2026 11:09:02 +0100, Alexander Ivanov wrote: > Alexander Ivanov (2): > drivers/vhost/blk: fix a flush hang on requests completed after worker > kill > drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES 1. I agree with Andrey. Once the VMM advertises the feature only for a backend that has WRITE ZEROES, the zero-page path and the retry are never taken. My v1 ask for small zero-page chunks goes away with them. 3. num_sectors is 32 bits, so a guest can ask for almost 2 TiB, while bi_size of one bio is an unsigned int in bytes. This check is needed, not optional: without it such a request wraps bi_size. 4. A Linux guest then gets -EIO from BLKZEROOUT and does not fall back to writing zeroes itself. So the VMM has to keep the condition true when it sets another backend after feature negotiation. Note on dm-qcow2: it has no REQ_OP_WRITE_ZEROES today. It does not set num_write_zeroes_bios, so dm sets max_write_zeroes_sectors to 0 and the VMM will not advertise the feature on it. The feature starts working on dm-qcow2 only once dm-qcow2 handles WRITE ZEROES. Thanks. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
