X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=mm%2Fmemory.c;h=2bee1f21aa8aa92294ef481778b3c370063413fb;hb=02df360bf38ca2acb78ddee9fd28262e9474153c;hp=7a11ddd5060ff51067523c7872b85e0539537385;hpb=80c0531514516e43ae118ddf38424e06e5c3cb3c;p=~andy%2Flinux diff --git a/mm/memory.c b/mm/memory.c index 7a11ddd5060..2bee1f21aa8 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1871,6 +1871,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, goto out; entry = pte_to_swp_entry(orig_pte); +again: page = lookup_swap_cache(entry); if (!page) { swapin_readahead(entry, address, vma); @@ -1894,6 +1895,12 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, mark_page_accessed(page); lock_page(page); + if (!PageSwapCache(page)) { + /* Page migration has occured */ + unlock_page(page); + page_cache_release(page); + goto again; + } /* * Back out if somebody else already faulted in this pte.