aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2013-11-18 08:11:42 -0500
committerJens Axboe <axboe@kernel.dk>2013-11-18 14:31:27 -0500
commit34f2fd8dfe6185b0eaaf7d661281713a6170b077 (patch)
treec33d3575e41db4350bce9e6f30d684ce735bebaf
parent2d3c627502f2a9b0a7de06a5a2df2365542a72c9 (diff)
bio: fix argument of __bio_add_page() for max_sectors > 0xffff
The data type of max_sectors and max_hw_sectors in queue settings are unsigned int. But these values are passed to __bio_add_page() as an argument whose data type is unsigned short. In the worst case such as max_sectors is 0x10000, bio_add_page() can't add a page and IOs can't proceed. Cc: Jens Axboe <axboe@kernel.dk> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/bio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 2bdb4e25ee77..33d79a4eb92d 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -601,7 +601,7 @@ EXPORT_SYMBOL(bio_get_nr_vecs);
601 601
602static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page 602static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page
603 *page, unsigned int len, unsigned int offset, 603 *page, unsigned int len, unsigned int offset,
604 unsigned short max_sectors) 604 unsigned int max_sectors)
605{ 605{
606 int retried_segments = 0; 606 int retried_segments = 0;
607 struct bio_vec *bvec; 607 struct bio_vec *bvec;