diff options
author | Petr Holasek <pholasek@redhat.com> | 2011-01-13 02:00:34 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 17:03:17 +0100 |
commit | a6fc86d2b43bf1086557f023a24adf91db915559 (patch) | |
tree | 4ad1a6f004d50c21bdce5b14d8f78fef3f453670 /fs | |
parent | proc: use single_open() correctly (diff) | |
download | linux-a6fc86d2b43bf1086557f023a24adf91db915559.tar.xz linux-a6fc86d2b43bf1086557f023a24adf91db915559.zip |
kpagecount: add slab page checking because _mapcount is in a union
Add a PageSlab() check before adding the _mapcount value to /kpagecount.
page->_mapcount is in a union with the SLAB structure so for pages
controlled by SLAB, page_mapcount() returns nonsense.
Signed-off-by: Petr Holasek <pholasek@redhat.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/page.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/page.c b/fs/proc/page.c index 3b8b45660331..b06c674624e6 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -40,7 +40,7 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf, ppage = pfn_to_page(pfn); else ppage = NULL; - if (!ppage) + if (!ppage || PageSlab(ppage)) pcount = 0; else pcount = page_mapcount(ppage); |