mm-add-pageanonnotksm-fix
authorMatthew Wilcox <willy@infradead.org>
Fri, 4 Oct 2024 17:43:52 +0000 (18:43 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:28:56 +0000 (21:28 -0700)
fix assertions

Link: https://lkml.kernel.org/r/ZwApWPER7caIA_N3@casper.infradead.org
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Cc: Alex Shi <alexs@kernel.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/page-flags.h

index dbca42c9c53caa32eecf438e4663fbd0e5ef5674..1fcef06a2d3164bfccca4618a7f7115a0eeada07 100644 (file)
@@ -1144,14 +1144,14 @@ static __always_inline int PageAnonExclusive(const struct page *page)
 
 static __always_inline void SetPageAnonExclusive(struct page *page)
 {
-       VM_BUG_ON_PGFLAGS(PageAnonNotKsm(page), page);
+       VM_BUG_ON_PGFLAGS(!PageAnonNotKsm(page), page);
        VM_BUG_ON_PGFLAGS(PageHuge(page) && !PageHead(page), page);
        set_bit(PG_anon_exclusive, &PF_ANY(page, 1)->flags);
 }
 
 static __always_inline void ClearPageAnonExclusive(struct page *page)
 {
-       VM_BUG_ON_PGFLAGS(PageAnonNotKsm(page), page);
+       VM_BUG_ON_PGFLAGS(!PageAnonNotKsm(page), page);
        VM_BUG_ON_PGFLAGS(PageHuge(page) && !PageHead(page), page);
        clear_bit(PG_anon_exclusive, &PF_ANY(page, 1)->flags);
 }