block: take offset into account in blk_bvec_map_sg again
authorChristoph Hellwig <hch@lst.de>
Tue, 9 Jul 2024 07:01:25 +0000 (09:01 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Jul 2024 07:02:44 +0000 (01:02 -0600)
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 <yi.zhang@redhat.com>
Reported-by: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240709070126.3019940-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c

index 1bce854790929a9c5ae0cfcf814059bad6f31413..de5281bcadc5383ef8e008cfbdf2684861049efc 100644 (file)
@@ -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;
 
                /*