lkml.org 
[lkml]   [2013]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysfs: return correct error code on unimplemented mmap()
On Mon, Oct 28, 2013 at 07:22:47PM +0200, Vladimir Zapolskiy wrote:
> On 10/28/13 18:35, Greg Kroah-Hartman wrote:
> >On Mon, Oct 28, 2013 at 06:28:30PM +0200, Vladimir Zapolskiy wrote:
> >>Both POSIX.1-2008 and Linux Programmer's Manual have a dedicated return
> >>error code for a case, when a file doesn't support mmap(), it's ENODEV.
> >>
> >>This change replaces overloaded EINVAL with ENODEV in a situation
> >>described above for sysfs binary files.
> >>
> >>Signed-off-by: Vladimir Zapolskiy<vladimir_zapolskiy@mentor.com>
> >>Cc: Greg Kroah-Hartman<gregkh@linuxfoundation.org>
> >
> >Is this a problem in linux-next or 3.12-rc7 and older kernels? What
> >userspace tool is breaking here?
>
> The patch itself is against 3.12-rc7, but the same problem can be found
> in older kernels as well.
>
> I assume the bugfix is quite safe, because both EINVAL and ENODEV should
> be handled by user space tools, however for developers it might be
> beneficial to distinguish cases of completely not supported mmap() and
> supported but misused mmap() applied to a binary sysfs file. At the
> moment from the user space perspective there is no indication of
> unsupported mmap() over a file in sysfs.

Ok, fair enough, but it doesn't apply to my tree given the recent sysfs
changes there. Can you redo this against linux-next, or wait for
3.13-rc1 and resend it against that release in a few weeks?

thanks,

greg k-h


\
 
 \ /
  Last update: 2013-10-30 00:21    [W:0.081 / U:2.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site