Commit fc31d16add13773265cc53d59f2e7594cb3c0a14

Authored by Wu Fengguang
Committed by Linus Torvalds
1 parent f7e839dd36

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -357,7 +357,7 @@
357 357 bool hit_readahead_marker, pgoff_t offset,
358 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 361 pgoff_t prev_offset;
362 362 int sequential;
363 363