diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-08-25 14:24:30 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-22 18:22:29 -0400 |
commit | 367fe711c5dc85dbc3265cf01e34d4d6fbd55f06 (patch) | |
tree | ff3b35b84371afd5fbb2b13ea5657bbda71e73df /drivers/infiniband | |
parent | ba11203a11835737df980ef3dd3bd8325b9cc94e (diff) |
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: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_file_ops.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c index 0b6e7679eefd..e999a46bef9b 100644 --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c | |||
@@ -992,15 +992,10 @@ static int mmap_piobufs(struct vm_area_struct *vma, | |||
992 | pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED; | 992 | pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED; |
993 | #endif | 993 | #endif |
994 | 994 | ||
995 | if (vma->vm_flags & VM_READ) { | 995 | /* |
996 | dev_info(&dd->pcidev->dev, | 996 | * don't allow them to later change to readable with mprotect (for when |
997 | "Can't map piobufs as readable (flags=%lx)\n", | 997 | * not initially mapped readable, as is normally the case) |
998 | vma->vm_flags); | 998 | */ |
999 | ret = -EPERM; | ||
1000 | goto bail; | ||
1001 | } | ||
1002 | |||
1003 | /* don't allow them to later change to readable with mprotect */ | ||
1004 | vma->vm_flags &= ~VM_MAYREAD; | 999 | vma->vm_flags &= ~VM_MAYREAD; |
1005 | vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; | 1000 | vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; |
1006 | 1001 | ||