]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/x86/mm/gup.c
mm: thp: tail page refcounting fix
[mv-sheeva.git] / arch / x86 / mm / gup.c
index dbe34b9313743f1cae72ac28aee5c99e5d2c9369..3b5032a62b0f3e41c98b98c0842500215e9e3e18 100644 (file)
@@ -114,8 +114,9 @@ static inline void get_huge_page_tail(struct page *page)
         * __split_huge_page_refcount() cannot run
         * from under us.
         */
-       VM_BUG_ON(atomic_read(&page->_count) < 0);
-       atomic_inc(&page->_count);
+       VM_BUG_ON(page_mapcount(page) < 0);
+       VM_BUG_ON(atomic_read(&page->_count) != 0);
+       atomic_inc(&page->_mapcount);
 }
 
 static noinline int gup_huge_pmd(pmd_t pmd, unsigned long addr,