Skip to content

Commit

Permalink
readahead: apply max_sane_readahead() limit in ondemand_readahead()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wu Fengguang authored and Linus Torvalds committed Jun 17, 2009
1 parent f7e839d commit fc31d16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/readahead.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit fc31d16

Please sign in to comment.