Skip to content

Commit

Permalink
bio: fix argument of __bio_add_page() for max_sectors > 0xffff
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Jens Axboe committed Nov 18, 2013
1 parent 2d3c627 commit 34f2fd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ EXPORT_SYMBOL(bio_get_nr_vecs);

static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page
*page, unsigned int len, unsigned int offset,
unsigned short max_sectors)
unsigned int max_sectors)
{
int retried_segments = 0;
struct bio_vec *bvec;
Expand Down

0 comments on commit 34f2fd8

Please sign in to comment.