Merge tag 'lsk-v4.4-16.06-android'
[firefly-linux-kernel-4.4.55.git] / mm / swap.c
index 983f692a47fdfbb80505fa77f673b9af37d08739..39395fb549c013e20b34d5fe0be8afa6eee5afbf 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -201,7 +201,7 @@ out_put_single:
                                __put_single_page(page);
                        return;
                }
-               VM_BUG_ON_PAGE(page_head != page->first_page, page);
+               VM_BUG_ON_PAGE(page_head != compound_head(page), page);
                /*
                 * We can release the refcount taken by
                 * get_page_unless_zero() now that
@@ -262,7 +262,7 @@ static void put_compound_page(struct page *page)
         *  Case 3 is possible, as we may race with
         *  __split_huge_page_refcount tearing down a THP page.
         */
-       page_head = compound_head_by_tail(page);
+       page_head = compound_head(page);
        if (!__compound_tail_refcounted(page_head))
                put_unrefcounted_compound_page(page_head, page);
        else