mm: PageBuddy and mapcount robustness
authorAndrea Arcangeli <aarcange@redhat.com>
Thu, 17 Mar 2011 23:16:35 +0000 (00:16 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Mar 2011 18:35:58 +0000 (11:35 -0700)
commit582d8b9e2879512507b8a9409f85fb1394e1c53e
tree54c34e9e80ba524daff7ae6a44673eb55bff6ba9
parentb62a6839fdf5cb733559164da4f5242ab6de8e06
mm: PageBuddy and mapcount robustness

commit ef2b4b95a63a1d23958dcb99eb2c6898eddc87d0 upstream.

Change the _mapcount value indicating PageBuddy from -2 to -128 for
more robusteness against page_mapcount() undeflows.

Use reset_page_mapcount instead of __ClearPageBuddy in bad_page to
ignore the previous retval of PageBuddy().

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Reported-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/mm.h
mm/page_alloc.c