summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Marzinski <bmarzins@redhat.com>2024-07-02 12:56:45 +0300
committerMikulas Patocka <mpatocka@redhat.com>2024-07-02 12:58:08 +0300
commit06a0b333e58407970e9b109d054610d2f107ca87 (patch)
tree093a4a9e2dfa8078ee35ea620f23163acc592e60
parentaaa53168cbcc486ca1927faac00bd99e81d4ff04 (diff)
downloadlinux-06a0b333e58407970e9b109d054610d2f107ca87.tar.xz
dm io: bump num_bvecs to handle offset memory
If dp->get_page() returns a non-zero offset, the bio might need an additional bvec to deal with the offset. For example, if remaining is exactly one page size, but there is an offset, the memory will span two pages. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
-rw-r--r--drivers/md/dm-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index 7409490259d1..3333943fe288 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -347,7 +347,7 @@ static void do_region(const blk_opf_t opf, unsigned int region,
break;
default:
num_bvecs = bio_max_segs(dm_sector_div_up(remaining,
- (PAGE_SIZE >> SECTOR_SHIFT)));
+ (PAGE_SIZE >> SECTOR_SHIFT)) + 1);
}
bio = bio_alloc_bioset(where->bdev, num_bvecs, opf, GFP_NOIO,