lkml.org 
[lkml]   [2007]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 9/9] readahead: call max_sane_readahead() in ondemand_readahead()
Apply the max_sane_readahead() limit in ondemand_readahead().
Just in case someone aggressively set a huge readahead size.

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
---
mm/readahead.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.24-rc4-mm1.orig/mm/readahead.c
+++ linux-2.6.24-rc4-mm1/mm/readahead.c
@@ -324,9 +324,9 @@ ondemand_readahead(struct address_space
bool hit_readahead_marker, pgoff_t offset,
unsigned long req_size)
{
- int max = ra->ra_pages; /* max readahead pages */
pgoff_t prev_offset;
- int sequential;
+ int sequential;
+ int max = max_sane_readahead(ra->ra_pages); /* max readahead pages */

/*
* It's the expected callback offset, assume sequential access.
--


\
 
 \ /
  Last update: 2007-12-16 13:09    [W:0.066 / U:4.132 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site