diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2013-11-18 08:13:18 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-20 20:48:44 -0500 |
commit | 475bf36ffba2ad18631865a2429468dc6c7ea919 (patch) | |
tree | f7e0f94e4def76598b66861e9a9820b9ab86517d /fs | |
parent | 4cd8587ce8fb79e49d1d6d1fc065f056188fb86a (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 0db637097862..92303f42baaa 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -5394,7 +5394,7 @@ static int bio_size_ok(struct block_device *bdev, struct bio *bio, | |||
5394 | { | 5394 | { |
5395 | struct bio_vec *prev; | 5395 | struct bio_vec *prev; |
5396 | struct request_queue *q = bdev_get_queue(bdev); | 5396 | struct request_queue *q = bdev_get_queue(bdev); |
5397 | unsigned short max_sectors = queue_max_sectors(q); | 5397 | unsigned int max_sectors = queue_max_sectors(q); |
5398 | struct bvec_merge_data bvm = { | 5398 | struct bvec_merge_data bvm = { |
5399 | .bi_bdev = bdev, | 5399 | .bi_bdev = bdev, |
5400 | .bi_sector = sector, | 5400 | .bi_sector = sector, |