VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Ming Lei <ming.lei@redhat.com> 2021-01-11 11:05:55 +0800 committer: Jens Axboe <axboe@kernel.dk> 2021-01-24 21:22:45 -0700 commit: baa2c7c97153b8064dbeeb99f2f72de3a75c90a7 parent: 9f180e315a93cde559ac1c9c4c5ce980aa681c1c
Commit Summary:
block: set .bi_max_vecs as actual allocated vector number
Diffstat:
1 file changed, 2 insertions, 1 deletion
diff --git a/block/bio.c b/block/bio.c
index 8ccda51dd831..56a06f94fb63 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -505,12 +505,13 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, unsigned int nr_iovecs,
 			goto err_free;
 
 		bio->bi_flags |= idx << BVEC_POOL_OFFSET;
+		bio->bi_max_vecs = bvec_nr_vecs(idx);
 	} else if (nr_iovecs) {
 		bvl = bio->bi_inline_vecs;
+		bio->bi_max_vecs = inline_vecs;
 	}
 
 	bio->bi_pool = bs;
-	bio->bi_max_vecs = nr_iovecs;
 	bio->bi_io_vec = bvl;
 	return bio;