mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 15:19:51 +00:00
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>
This commit is contained in:
parent
f7e839dd36
commit
fc31d16add
@ -357,7 +357,7 @@ ondemand_readahead(struct address_space *mapping,
|
|||||||
bool hit_readahead_marker, pgoff_t offset,
|
bool hit_readahead_marker, pgoff_t offset,
|
||||||
unsigned long req_size)
|
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;
|
pgoff_t prev_offset;
|
||||||
int sequential;
|
int sequential;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user