*remain in query_page_cache_segment() is over counted by 1, fix it.
Signed-off-by: Wu Fengguang <[email protected]>
---
--- linux-2.6.17-rc4-mm3.orig/mm/readahead.c
+++ linux-2.6.17-rc4-mm3/mm/readahead.c
@@ -1334,7 +1334,7 @@ static unsigned long query_page_cache_se
index = radix_tree_scan_hole_backward(&mapping->page_tree,
offset - 1, ra_max);
- *remain = offset - index;
+ *remain = (offset - 1) - index;
if (offset == ra->readahead_index && ra_cache_hit_ok(ra))
count = *remain;
--