aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2004-09-08 20:34:49 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-08 20:34:49 -0700
commitee1afb3fffc59e99dfb29e291736ab656699b532 (patch)
tree4eb6bbc255f5494cc2c0976247603ad7034eaf1c /mm
parent474c45516bdb8551b94ad2569f4e42809705a955 (diff)
downloadhistory-ee1afb3fffc59e99dfb29e291736ab656699b532.tar.gz
[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: Jens Axboe <axboe@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/highmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/highmem.c b/mm/highmem.c
index 432da5b68baf5a..c4debe2576473a 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -284,7 +284,7 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
struct bio_vec *tovec, *fromvec;
int i;
- bio_for_each_segment(tovec, to, i) {
+ __bio_for_each_segment(tovec, to, i, 0) {
fromvec = from->bi_io_vec + i;
/*
@@ -316,7 +316,7 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool)
/*
* 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;
if (bvec->bv_page == org_vec->bv_page)
continue;