1
0
Fork 0

btrfs: fix bio_size_ok() for max_sectors > 0xffff

The data type of max_sectors in queue settings is unsigned int.  But
this value is stored to the local variable whose type is unsigned short
in bio_size_ok().  This can cause unexpected result when max_sectors >
0xffff.

Cc: Chris Mason <chris.mason@fusionio.com>
Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
hifive-unleashed-5.1
Akinobu Mita 2013-11-18 22:13:18 +09:00 committed by Chris Mason
parent 4cd8587ce8
commit 475bf36ffb
1 changed files with 1 additions and 1 deletions

View File

@ -5394,7 +5394,7 @@ static int bio_size_ok(struct block_device *bdev, struct bio *bio,
{
struct bio_vec *prev;
struct request_queue *q = bdev_get_queue(bdev);
unsigned short max_sectors = queue_max_sectors(q);
unsigned int max_sectors = queue_max_sectors(q);
struct bvec_merge_data bvm = {
.bi_bdev = bdev,
.bi_sector = sector,