Commit 802c64c9 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix small highmem bio bounce bvec handling glitch

From: Christophe Saout <christophe@saout.de>

__end_that_request_first might modify the bv_offset and bv_len if the
segment was partially completed.  The bio-read-bounce-back code should use
the unmodified bv_offset when copying the segment data:
parent 2a82ff98
...@@ -294,7 +294,12 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from) ...@@ -294,7 +294,12 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
if (tovec->bv_page == fromvec->bv_page) if (tovec->bv_page == fromvec->bv_page)
continue; continue;
vfrom = page_address(fromvec->bv_page) + fromvec->bv_offset; /*
* fromvec->bv_offset and fromvec->bv_len might have been
* modified by the block layer, so use the original copy,
* bounce_copy_vec already uses tovec->bv_len
*/
vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
bounce_copy_vec(tovec, vfrom); bounce_copy_vec(tovec, vfrom);
} }
......
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