]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/migrate.c: pair unlock_page() and lock_page() when migrating huge pages
authorHillf Danton <dhillf@gmail.com>
Fri, 2 Dec 2011 03:06:50 +0000 (14:06 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 2 Dec 2011 03:15:16 +0000 (14:15 +1100)
Avoid unlocking and unlocked page if we failed to lock it.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/migrate.c

index 578e29174fa6a0b84e8cbb10f8bf22ffd9a37b57..177aca424a069ac1ae1b44d48a8e6d992cd42a4d 100644 (file)
@@ -871,9 +871,9 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
 
        if (anon_vma)
                put_anon_vma(anon_vma);
-out:
        unlock_page(hpage);
 
+out:
        if (rc != -EAGAIN) {
                list_del(&hpage->lru);
                put_page(hpage);