Commit ee1afb3f authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] fix highmem bouncing leaking pages

In highmem end_io handling, we need to iterate over the completed bio
from 0, not bio->bi_idx. If not we leak N-1 pages for any bio with N
pages where N > 1.
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 474c4551
...@@ -284,7 +284,7 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from) ...@@ -284,7 +284,7 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
struct bio_vec *tovec, *fromvec; struct bio_vec *tovec, *fromvec;
int i; int i;
bio_for_each_segment(tovec, to, i) { __bio_for_each_segment(tovec, to, i, 0) {
fromvec = from->bi_io_vec + i; fromvec = from->bi_io_vec + i;
/* /*
...@@ -316,7 +316,7 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool) ...@@ -316,7 +316,7 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool)
/* /*
* free up bounce indirect pages used * free up bounce indirect pages used
*/ */
bio_for_each_segment(bvec, bio, i) { __bio_for_each_segment(bvec, bio, i, 0) {
org_vec = bio_orig->bi_io_vec + i; org_vec = bio_orig->bi_io_vec + i;
if (bvec->bv_page == org_vec->bv_page) if (bvec->bv_page == org_vec->bv_page)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment