From: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx> Currently, we're only checking that a page is not compound when we're setting or clearing a bit. We should probably be checking the page isn't compound when testing the bit too. Signed-off-by: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx> --- include/linux/page-flags.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index ac55f6c94c0a..1960b5e4b9ab 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -178,11 +178,10 @@ struct page *PagePolicyTailRead(struct page *page, bool modify) return compound_head(page); } -static __always_inline -struct page *PagePolicyNoCompound(struct page *page, bool modify) +static __always_inline struct page *PagePolicyNoCompound(struct page *page) { CheckPageInit(page); - VM_BUG_ON_PGFLAGS(modify && PageCompound(page), page); + VM_BUG_ON_PGFLAGS(PageCompound(page), page); return page; } @@ -212,7 +211,7 @@ struct page *PagePolicyNoCompound(struct page *page, bool modify) #define PF_HEAD(page, modify) compound_head(CheckPageInit(page)) #define PF_ONLY_HEAD(page, modify) PagePolicyOnlyHead(page) #define PF_TAIL_READ(page, modify) PagePolicyTailRead(page, modify) -#define PF_NO_COMPOUND(page, modify) PagePolicyNoCompound(page, modify) +#define PF_NO_COMPOUND(page, modify) PagePolicyNoCompound(page) /* * Macros to create function definitions for page flags -- 2.16.3