aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/readahead.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index 829a77c62834..e4ed04149785 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -371,10 +371,10 @@ static int try_context_readahead(struct address_space *mapping,
371 size = count_history_pages(mapping, ra, offset, max); 371 size = count_history_pages(mapping, ra, offset, max);
372 372
373 /* 373 /*
374 * no history pages: 374 * not enough history pages:
375 * it could be a random read 375 * it could be a random read
376 */ 376 */
377 if (!size) 377 if (size <= req_size)
378 return 0; 378 return 0;
379 379
380 /* 380 /*
@@ -385,8 +385,8 @@ static int try_context_readahead(struct address_space *mapping,
385 size *= 2; 385 size *= 2;
386 386
387 ra->start = offset; 387 ra->start = offset;
388 ra->size = get_init_ra_size(size + req_size, max); 388 ra->size = min(size + req_size, max);
389 ra->async_size = ra->size; 389 ra->async_size = 1;
390 390
391 return 1; 391 return 1;
392} 392}