Skip to contentSkip to conversation

block: blk_phys_contig_segment() doesn't account for bounce pages

PATCH New Malahal Naineni 1 participant 1 message Aug 29, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: blk_phys_contig_segment() doesn't account for bounce pages

blk_phys_contig_segment() doesn't account for bouce pages and a later recalculation that accounts for bounce pages, in blk_rq_check_limits() while dispatching the request, fails with "over max segments limit".

block/blk-merge.c +7 -0
diff -r 528f6f2c7e80 -r 5d97698a7bc5 block/blk-merge.c
@@ -101,6 +101,13 @@ static int blk_phys_contig_segment(struc
 		return 0;
 
 	/*
+	 * A high page is never considered part of another segment,
+	 * since that might change with the bounce page.
+	 */
+	if (page_to_pfn(__BVEC_END(bio)->bv_page) > queue_bounce_pfn(q) ||
+	    page_to_pfn(__BVEC_START(nxt)->bv_page) > queue_bounce_pfn(q))
+		return 0;
+	/*
 	 * bio and nxt are contiguous in memory; check if the queue allows
 	 * these two to be merged into one
 	 */