1883 /*
1884 * The VM_FAULT_WRITE bit tells us that
1885 * do_wp_page has broken COW when necessary,
1886 * even if maybe_mkwrite decided not to set
1887 * pte_write. We can thus safely do subsequent
1888 * page lookups as if they were reads. But only
1889 * do so when looping for pte_write is futile:
1890 * in some cases userspace may also be wanting
1891 * to write to the gotten user page, which a
1892 * read fault here might prevent (a readonly
1893 * page might get reCOWed by userspace write).
1894 */
1895 if ((ret & VM_FAULT_WRITE) &&
1896 !(vma->vm_flags & VM_WRITE))
1897 foll_flags &= ~FOLL_WRITE;
1898
1899 cond_resched();