mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Holasek <pholasek@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: tiwai@suse.de, akpm@linux-foundation.org,
	Petr Holasek <pholasek@redhat.com>
Subject: [PATCH] kpagecount: added slab page checking because of _mapcount in union
Date: Thu, 16 Dec 2010 18:10:40 +0100	[thread overview]
Message-ID: <1292519440-26763-1-git-send-email-pholasek@redhat.com> (raw)

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


                 reply	other threads:[~2010-12-16 17:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292519440-26763-1-git-send-email-pholasek@redhat.com \
    --to=pholasek@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®