public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix panic in 2.6 with bounced bio and dm
@ 2005-02-25 17:03 Mark Haverkamp
  2005-02-25 17:13 ` Mark Haverkamp
  2005-02-26  0:19 ` Andrew Morton
  0 siblings, 2 replies; 13+ messages in thread
From: Mark Haverkamp @ 2005-02-25 17:03 UTC (permalink / raw)
  To: Jens Axboe, linux-kernel


Last September a fix was checked in for a memory leak problem in
bounce_end_io causing the entire bio to be checked.  This ended up
causing some dm cloned bios that had bounce buffers to free NULL pages
because their bi_idx can be non-zero.   This patch skips NULL pages in
the bio's bio_vec.  I'm not sure if this is the most optimal fix but I
think that it is safe since bvec_alloc memsets the bio_vec to zero.

Mark.

===== mm/highmem.c 1.55 vs edited =====
--- 1.55/mm/highmem.c	2005-01-07 21:44:13 -08:00
+++ edited/mm/highmem.c	2005-02-25 07:54:21 -08:00
@@ -319,7 +319,7 @@
 	 */
 	__bio_for_each_segment(bvec, bio, i, 0) {
 		org_vec = bio_orig->bi_io_vec + i;
-		if (bvec->bv_page == org_vec->bv_page)
+		if (!bvec->bv_page || bvec->bv_page == org_vec->bv_page)
 			continue;
 
 		mempool_free(bvec->bv_page, pool);	

-- 
Mark Haverkamp <markh@osdl.org>


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-02-28 17:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-25 17:03 [PATCH] Fix panic in 2.6 with bounced bio and dm Mark Haverkamp
2005-02-25 17:13 ` Mark Haverkamp
2005-02-26  0:19 ` Andrew Morton
2005-02-26  0:40   ` Linus Torvalds
2005-02-26 12:39     ` Jens Axboe
2005-02-28 15:32       ` Mark Haverkamp
2005-02-28 15:43         ` Mark Haverkamp
2005-02-28 15:51         ` Jens Axboe
2005-02-28 16:13           ` Mark Haverkamp
2005-02-28 16:15             ` Mark Haverkamp
2005-02-28 16:21             ` Jens Axboe
2005-02-28 17:35           ` Dave Olien
2005-02-28 17:40             ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox