From: Anthony Yznaga Date: Fri, 28 Dec 2018 08:37:27 +0000 (-0800) Subject: tools/vm/page-types.c: fix "kpagecount returned fewer pages than expected" failures X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b6fb87b8e3ff1ef6bcf68470f24a97c984554d5a;p=openwrt%2Fstaging%2Fblogic.git tools/vm/page-types.c: fix "kpagecount returned fewer pages than expected" failures 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 Reviewed-by: Naoya Horiguchi Cc: Vlastimil Babka Cc: Matthew Wilcox Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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++)