]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix small highmem bio bounce bvec handling glitch
authorAndrew Morton <akpm@osdl.org>
Mon, 1 Mar 2004 15:02:08 +0000 (07:02 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 1 Mar 2004 15:02:08 +0000 (07:02 -0800)
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:

mm/highmem.c

index e131a05dee62912664e29949f4b89e8df4e4db10..b7d63e710bddde65e97c05ff788244d1bd6466ac 100644 (file)
@@ -294,7 +294,12 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
                if (tovec->bv_page == fromvec->bv_page)
                        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);
        }