On Wed 16-11-16 01:52:10, Kirill A. Shutemov wrote:
On Fri, Nov 04, 2016 at 05:25:12AM +0100, Jan Kara wrote:
quoted
Provide a helper function for finishing write faults due to PTE being
read-only. The helper will be used by DAX to avoid the need of
complicating generic MM code with DAX locking specifics.
Reviewed-by: Ross Zwisler <redacted>
Signed-off-by: Jan Kara <jack@suse.cz>
...
quoted
- /*
- * Since we dropped the lock we need to revalidate
- * the PTE as someone else may have changed it. If
- * they did, we just return, as we can count on the
- * MMU to tell us if they didn't also make it writable.
- */
- vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,
- vmf->address, &vmf->ptl);
- if (!pte_same(*vmf->pte, vmf->orig_pte)) {
+ tmp = finish_mkwrite_fault(vmf);
+ if (unlikely(!tmp || (tmp &
+ (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))) {
Looks like the second part of condition is never true here, right? Not
that it would matter, having the next patch in the queue.
Yeah, I had the condition like this to handle the standard set of return
values. And as you say, the next patch even makes this condition have a
real effect.
Acked-by: Kirill A. Shutemov <redacted>
Thanks.
Honza
--
Jan Kara [off-list ref]
SUSE Labs, CR
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>