diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2009-06-16 18:31:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:47:28 -0400 |
commit | fc31d16add13773265cc53d59f2e7594cb3c0a14 (patch) | |
tree | fe67988da0a8b7bd08cdf3da95c852373638e06b /mm/readahead.c | |
parent | f7e839dd36fd940b0202cfb7d39b2a1b2dc59b1b (diff) |
readahead: apply max_sane_readahead() limit in ondemand_readahead()
Just in case someone aggressively sets a huge readahead size.
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/readahead.c')
-rw-r--r-- | mm/readahead.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, | |||
357 | bool hit_readahead_marker, pgoff_t offset, | 357 | bool hit_readahead_marker, pgoff_t offset, |
358 | unsigned long req_size) | 358 | unsigned long req_size) |
359 | { | 359 | { |
360 | int max = ra->ra_pages; /* max readahead pages */ | 360 | unsigned long max = max_sane_readahead(ra->ra_pages); |
361 | pgoff_t prev_offset; | 361 | pgoff_t prev_offset; |
362 | int sequential; | 362 | int sequential; |
363 | 363 | ||