author: Matthew Wilcox (Oracle) <willy@infradead.org> 2021-01-29 04:38:57 +0000
committer: Jens Axboe <axboe@kernel.dk> 2021-02-26 15:49:51 -0700
commit: 5f7136db82996089cdfb2939c7664b29e9da141d
parent: 94d4bffdda21baa2c749bc229c41811a7559dd15
Commit Summary:
Diffstat:
1 file changed, 1 insertion, 2 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index da16121140ca..1cdf09ff67b6 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -1326,9 +1326,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
pages[i]->page,
seg[i].nsec << 9,
seg[i].offset) == 0)) {
-
- int nr_iovecs = min_t(int, (nseg-i), BIO_MAX_PAGES);
- bio = bio_alloc(GFP_KERNEL, nr_iovecs);
+ bio = bio_alloc(GFP_KERNEL, bio_max_segs(nseg - i));
if (unlikely(bio == NULL))
goto fail_put_bio;