Re: [PATCH] virtio-blk: Fix zone append sector reporting in batched completion

From: Christoph Hellwig

Date: Tue Oct 27 2026 - 11:18:43 EST


On Mon, Oct 26, 2026 at 07:55:19PM +0800, shao.mingyin@xxxxxxxxxx wrote:
> From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
>
> For zone append, the block layer copies req->__sector back into the
> bio in blk_zone_append_update_request_bio(), so the driver must update
> req->__sector with the sector reported by the device.
> virtblk_request_done() does that, but the batched completion path used
> by virtblk_poll() only unmaps and cleans up the requests before calling
> blk_mq_end_request_batch().
>
> A zone append completed through polling therefore keeps the sector that
> was assigned at submission time, and the file system or application sees
> the wrong LBA for the written data.
>
> Move the sector update into a helper and call it from both completion
> paths.

Looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Can you add something to blktests to exercises this?