mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kpagecount: added slab page checking because of _mapcount in union
@ 2010-12-16 17:10 Petr Holasek
  0 siblings, 0 replies; only message in thread
From: Petr Holasek @ 2010-12-16 17:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: tiwai, akpm, Petr Holasek

PageSlab macro check was added before putting of _mapcount value
to /kpagecount. page->_mapcount is in union with SLAB structure
so for pages controlled by SLAB page_mapcount() returns nonsenses.

Signed-off-by: Petr Holasek <pholasek@redhat.com>
---
 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 3b8b456..b06c674 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);
--
1.7.2.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-16 17:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-16 17:10 [PATCH] kpagecount: added slab page checking because of _mapcount in union Petr Holasek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®