Skip to content

Commit

Permalink
vmscan: avoid multiplication overflow in shrink_zone()
Browse files Browse the repository at this point in the history
Local variable `scan' can overflow on zones which are larger than

	(2G * 4k) / 100 = 80GB.

Making it 64-bit on 64-bit will fix that up.

Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
akpm00 authored and torvalds committed May 2, 2009
1 parent 0ae05fb commit 8713e01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ static void shrink_zone(int priority, struct zone *zone,

for_each_evictable_lru(l) {
int file = is_file_lru(l);
int scan;
unsigned long scan;

scan = zone_nr_pages(zone, sc, l);
if (priority) {
Expand Down

0 comments on commit 8713e01

Please sign in to comment.