Skip to content

Commit b6fb87b

Browse files
Anthony Yznagatorvalds
authored andcommitted
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/[email protected] Fixes: 7f1d23e ("tools/vm/page-types.c: include shared map counts") Signed-off-by: Anthony Yznaga <[email protected]> Reviewed-by: Naoya Horiguchi <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent bbe5d99 commit b6fb87b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/vm/page-types.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ static void walk_pfn(unsigned long voffset,
701701
if (kpagecgroup_read(cgi, index, pages) != pages)
702702
fatal("kpagecgroup returned fewer pages than expected");
703703

704-
if (kpagecount_read(cnt, index, batch) != pages)
704+
if (kpagecount_read(cnt, index, pages) != pages)
705705
fatal("kpagecount returned fewer pages than expected");
706706

707707
for (i = 0; i < pages; i++)

0 commit comments

Comments
 (0)