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 <[email protected]>
Signed-off-by: Wu Fengguang <[email protected]>
Cc: Ying Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Wu Fengguang authored and 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.