[PATCH 9/9] readahead: call max_sane_readahead() in ondemand_readahead()

From: Fengguang Wu
Date: Sun Dec 16 2007 - 07:05:46 EST


Apply the max_sane_readahead() limit in ondemand_readahead().
Just in case someone aggressively set a huge readahead size.

Signed-off-by: Fengguang Wu <wfg@xxxxxxxxxxxxxxxx>
---
mm/readahead.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.24-rc4-mm1.orig/mm/readahead.c
+++ linux-2.6.24-rc4-mm1/mm/readahead.c
@@ -324,9 +324,9 @@ ondemand_readahead(struct address_space
bool hit_readahead_marker, pgoff_t offset,
unsigned long req_size)
{
- int max = ra->ra_pages; /* max readahead pages */
pgoff_t prev_offset;
- int sequential;
+ int sequential;
+ int max = max_sane_readahead(ra->ra_pages); /* max readahead pages */

/*
* It's the expected callback offset, assume sequential access.

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/