diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2013-11-18 22:11:42 +0900 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-09-02 16:52:56 +0200 |
commit | 52c312106a2268b7c2a93464373d5ca60d3566fd (patch) | |
tree | 4dab2c2d84bd4b042b7c877478c5f051815f6be1 /fs/bio.c | |
parent | 62d80e38ed89ca1e7dc9424c7c4438d46be924d9 (diff) | |
download | lwn-52c312106a2268b7c2a93464373d5ca60d3566fd.tar.gz lwn-52c312106a2268b7c2a93464373d5ca60d3566fd.zip |
bio: fix argument of __bio_add_page() for max_sectors > 0xffff
commit 34f2fd8dfe6185b0eaaf7d661281713a6170b077 upstream.
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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |