diff options
author | Anthony Yznaga <anthony.yznaga@oracle.com> | 2018-12-28 00:37:27 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 09:20:59 +0100 |
commit | a787b7ac3cc79cc8ad02e91385b9c7f5adebd31c (patch) | |
tree | 2d611f0049c86d869e1582cdfa761c5d1413798d /tools | |
parent | 5643569bec7d03e49c27e732e011219af87caeaf (diff) | |
download | linux-stable-a787b7ac3cc79cc8ad02e91385b9c7f5adebd31c.tar.gz linux-stable-a787b7ac3cc79cc8ad02e91385b9c7f5adebd31c.tar.bz2 linux-stable-a787b7ac3cc79cc8ad02e91385b9c7f5adebd31c.zip |
tools/vm/page-types.c: fix "kpagecount returned fewer pages than expected" failures
[ Upstream commit b6fb87b8e3ff1ef6bcf68470f24a97c984554d5a ]
Because kpagecount_read() fakes success if map counts are not being
collected, clamp the page count passed to it by walk_pfn() to the pages
value returned by the preceding call to kpageflags_read().
Link: http://lkml.kernel.org/r/1543962269-26116-1-git-send-email-anthony.yznaga@oracle.com
Fixes: 7f1d23e60718 ("tools/vm/page-types.c: include shared map counts")
Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/vm/page-types.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c index 37908a83ddc2..1ff3a6c0367b 100644 --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c @@ -701,7 +701,7 @@ static void walk_pfn(unsigned long voffset, if (kpagecgroup_read(cgi, index, pages) != pages) fatal("kpagecgroup returned fewer pages than expected"); - if (kpagecount_read(cnt, index, batch) != pages) + if (kpagecount_read(cnt, index, pages) != pages) fatal("kpagecount returned fewer pages than expected"); for (i = 0; i < pages; i++) |