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-Tag: v3.0~8940^2~175 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc31d16add13773265cc53d59f2e7594cb3c0a14;p=platform%2Fkernel%2Flinux-amlogic.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 a224182..bd0f0e8 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;