[Devel] [PATCH hci-8.2 v3 2/4] drivers/vhost/blk: stop failing write zeroes above the backend limit

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 25 15:32:09 MSK 2026


I won't apply this version, please send v4 with the changes below.

- Say that the zero-limit check goes too, and keep the cap advice:
  item 1 of the cover letter reply.

On Wed, 25 Nov 2026 12:57:01 +0100, Alexander Ivanov wrote:
> -	if (vhost_blk_backend_ro(f) || !max_sects ||
> -	    nr_sects > UINT_MAX >> SECTOR_SHIFT || nr_sects > max_sects ||

The patch drops !max_sects as well. Until 3/4 a backend without WRITE
ZEROES still gets IOERR, through the BLK_STS_NOTSUPP of
submit_bio_noacct(); say so, as 3/4 builds on it.

> Drop the check. The VMM then need not set max_write_zeroes_sectors from
> the limit of the backend.

It still has to cap it at 8388607 rounded down to the logical block
size: the parser keeps both checks. 4/4 gives that advice for discard;
give the same here.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list