diff -urN 2.4.0-test4-pre6/mm/swapfile.c vm-25/mm/swapfile.c --- 2.4.0-test4-pre6/mm/swapfile.c Tue Jul 11 03:50:44 2000 +++ vm-25/mm/swapfile.c Sat Jul 15 18:05:59 2000 @@ -315,10 +315,20 @@ */ if (!mm) return; + /* + * Avoid the vmas to go away from under us + * and also avoids the task to play with + * pagetables under do_wp_page(). If the + * vmlist_modify_lock wouldn't acquire the + * mm->page_table_lock spinlock we should + * acquire it by hand. + */ + vmlist_access_lock(mm); for (vma = mm->mmap; vma; vma = vma->vm_next) { pgd_t * pgd = pgd_offset(mm, vma->vm_start); unuse_vma(vma, pgd, entry, page); } + vmlist_access_unlock(mm); return; }