lkml.org 
[lkml]   [2013]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/16] perf, persistent: Return -EACCES if mapped buffers must be readonly
On Fri, May 31, 2013 at 10:47:26AM +0200, Robert Richter wrote:
> From: Robert Richter <robert.richter@calxeda.com>
>
> mmap should return EACCES error if fd can not be opened writable.
> This error code also helps userland to map buffers readonly on
> failure.
>
> Signed-off-by: Robert Richter <robert.richter@calxeda.com>
> ---
> kernel/events/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 0730f36..a9b6470 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -3761,7 +3761,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
> return -EINVAL;
>
> if (event->attr.persistent && (vma->vm_flags & VM_WRITE))
> - return -EINVAL;
> + return -EACCES;
>
> vma_size = vma->vm_end - vma->vm_start;
> nr_pages = (vma_size / PAGE_SIZE) - 1;

Also merge.


\
 
 \ /
  Last update: 2013-05-31 11:41    [W:0.154 / U:1.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site