From: Wu Fengguang Date: Tue, 16 Jun 2009 22:31:21 +0000 (-0700) Subject: readahead: apply max_sane_readahead() limit in ondemand_readahead() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fc31d16add13773265cc53d59f2e7594cb3c0a14;p=linux-beck.git readahead: apply max_sane_readahead() limit in ondemand_readahead() Just in case someone aggressively sets a huge readahead size. Cc: Nick Piggin Signed-off-by: Wu Fengguang Cc: Ying Han Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/readahead.c b/mm/readahead.c index a224182a3a63..bd0f0e88b0a1 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -357,7 +357,7 @@ ondemand_readahead(struct address_space *mapping, bool hit_readahead_marker, pgoff_t offset, unsigned long req_size) { - int max = ra->ra_pages; /* max readahead pages */ + unsigned long max = max_sane_readahead(ra->ra_pages); pgoff_t prev_offset; int sequential;