]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
thp, mm: locking tail page is a bug
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Thu, 18 Jul 2013 23:56:46 +0000 (09:56 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 18 Jul 2013 23:56:46 +0000 (09:56 +1000)
Locking head page means locking entire compound page.  If we try to lock
tail page, something went wrong.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/filemap.c

index f1ca99cf5aa893cdc082d43bec37ce8cd219cc12..a6981feed8e7a17655ca41112b81988a27e2fbd9 100644 (file)
@@ -639,6 +639,7 @@ void __lock_page(struct page *page)
 {
        DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
 
+       VM_BUG_ON(PageTail(page));
        __wait_on_bit_lock(page_waitqueue(page), &wait, sleep_on_page,
                                                        TASK_UNINTERRUPTIBLE);
 }
@@ -648,6 +649,7 @@ int __lock_page_killable(struct page *page)
 {
        DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
 
+       VM_BUG_ON(PageTail(page));
        return __wait_on_bit_lock(page_waitqueue(page), &wait,
                                        sleep_on_page_killable, TASK_KILLABLE);
 }