···949949950950 cond_resched_lock(&mm->page_table_lock);951951 while (!(page = follow_page(mm, start, write_access))) {952952+ int ret;953953+952954 /*953955 * Shortcut for anonymous pages. We don't want954956 * to force the creation of pages tables for···963961 break;964962 }965963 spin_unlock(&mm->page_table_lock);966966- switch (__handle_mm_fault(mm, vma, start,967967- write_access)) {968968- case VM_FAULT_WRITE:969969- /*970970- * do_wp_page has broken COW when971971- * necessary, even if maybe_mkwrite972972- * decided not to set pte_write973973- */964964+ ret = __handle_mm_fault(mm, vma, start, write_access);965965+966966+ /*967967+ * The VM_FAULT_WRITE bit tells us that do_wp_page has968968+ * broken COW when necessary, even if maybe_mkwrite969969+ * decided not to set pte_write. We can thus safely do970970+ * subsequent page lookups as if they were reads.971971+ */972972+ if (ret & VM_FAULT_WRITE)974973 write_access = 0;975975- /* FALLTHRU */974974+975975+ switch (ret & ~VM_FAULT_WRITE) {976976 case VM_FAULT_MINOR:977977 tsk->min_flt++;978978 break;