From: Christoph Hellwig Date: Tue, 9 Jul 2024 07:01:25 +0000 (+0200) Subject: block: take offset into account in blk_bvec_map_sg again X-Git-Tag: for-6.11/block-20240710~5 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=61353a63a22890f2c642232ae1ab4a2e02e6a27c;p=linux-block.git block: take offset into account in blk_bvec_map_sg again The rebase of commit 09595e0c9d65 ("block: pass a phys_addr_t to get_max_segment_size") lost adding the total to to the offset in blk_bvec_map_sg. Add it back. Fixes: 09595e0c9d65 ("block: pass a phys_addr_t to get_max_segment_size") Reported-by: Yi Zhang Reported-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20240709070126.3019940-1-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/block/blk-merge.c b/block/blk-merge.c index 1bce85479092..de5281bcadc5 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -491,8 +491,8 @@ static unsigned blk_bvec_map_sg(struct request_queue *q, while (nbytes > 0) { unsigned offset = bvec->bv_offset + total; - unsigned len = get_max_segment_size(&q->limits, bvec_phys(bvec), - nbytes); + unsigned len = get_max_segment_size(&q->limits, + bvec_phys(bvec) + total, nbytes); struct page *page = bvec->bv_page; /*