Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422790AbWHYS3M (ORCPT ); Fri, 25 Aug 2006 14:29:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1422787AbWHYSZY (ORCPT ); Fri, 25 Aug 2006 14:25:24 -0400 Received: from mx.pathscale.com ([64.160.42.68]:41346 "EHLO mx.pathscale.com") by vger.kernel.org with ESMTP id S1422739AbWHYSZS (ORCPT ); Fri, 25 Aug 2006 14:25:18 -0400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH 5 of 23] IB/ipath - drop requirement that PIO buffers be mmaped write-only X-Mercurial-Node: f57aaab357b7fb0c0c393cb523ae070448dec0d0 Message-Id: In-Reply-To: Date: Fri, 25 Aug 2006 11:24:30 -0700 From: "Bryan O'Sullivan" To: rdreier@cisco.com Cc: openib-general@openib.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1240 Lines: 32 Some userlands try to mmap these pages read-write, so accommodate them. Signed-off-by: Bryan O'Sullivan diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c Fri Aug 25 11:19:44 2006 -0700 +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c Fri Aug 25 11:19:44 2006 -0700 @@ -992,15 +992,10 @@ static int mmap_piobufs(struct vm_area_s 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; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/