Re: [PATCH] ublk: don't mutate struct bio_vec in iteration

From: Ming Lei
Date: Mon Dec 08 2025 - 22:57:01 EST


On Mon, Dec 08, 2025 at 08:14:23PM -0700, Caleb Sander Mateos wrote:
> __bio_for_each_segment() uses the returned struct bio_vec's bv_len field
> to advance the struct bvec_iter at the end of each loop iteration. So
> it's incorrect to modify it during the loop. Don't assign to bv_len (or
> bv_offset, for that matter) in ublk_copy_user_pages().
>
> Signed-off-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
> Fixes: e87d66ab27ac ("ublk: use rq_for_each_segment() for user copy")

Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>


Thanks,
Ming