Skip to content
Commit af498d7f authored by Kazuhisa Ichikawa's avatar Kazuhisa Ichikawa Committed by Jens Axboe
Browse files

block: fix the bio_vec array index out-of-bounds test



Current bio_vec array index out-of-bounds test within
__end_that_request_first() does not seem correct.
It checks bio->bi_idx against bio->bi_vcnt, but the subsequent code
uses idx (which is, bio->bi_idx + next_idx) as the array index into
bio_vec array. This means that the test really make sense only at
the first iteration of !(nr_bytes >=bio->bi_size) case (when next_idx
== zero). Fix this by replacing bio->bi_idx with idx.
(This patch applies to 2.6.30-rc4.)

Signed-off-by: default avatarKazuhisa Ichikawa <ki@epsilou.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent a4d7749b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment