提交 367fe711 编写于 作者: B Bryan O'Sullivan 提交者: Roland Dreier

IB/ipath: drop requirement that PIO buffers be mmaped write-only

Some userlands try to mmap these pages read-write, so accommodate them.
Signed-off-by: NBryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 ba11203a
......@@ -992,15 +992,10 @@ static int mmap_piobufs(struct vm_area_struct *vma,
pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
#endif
if (vma->vm_flags & VM_READ) {
dev_info(&dd->pcidev->dev,
"Can't map piobufs as readable (flags=%lx)\n",
vma->vm_flags);
ret = -EPERM;
goto bail;
}
/* don't allow them to later change to readable with mprotect */
/*
* don't allow them to later change to readable with mprotect (for when
* not initially mapped readable, as is normally the case)
*/
vma->vm_flags &= ~VM_MAYREAD;
vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册