From: Thomas Gleixner <tglx@linutronix.de>
To: Arnd Bergmann <arndbergmann@googlemail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jeff Dike <jdike@addtoit.com>
Subject: Re: [patch 6/7] um: Convert mmapper to unlocked_ioctl
Date: Sat, 17 Oct 2009 04:58:10 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.0910170456530.2890@localhost.localdomain> (raw)
In-Reply-To: <200910162142.50618.arnd@arndb.de>
On Fri, 16 Oct 2009, Arnd Bergmann wrote:
> On Thursday 15 October 2009, Alan Cox wrote:
> > On Thu, 15 Oct 2009 15:00:34 +0200
> > Arnd Bergmann <arndbergmann@googlemail.com> wrote:
> >
> > > However, returning -ENOIOCTLCMD from an *unlocked_ioctl* function
> > > automatically gets turned into -EINVAL. It does this to allow
> > > the same functions to be used for unlocked_ioctl and compat_ioctl.
> > > In effect, this patch is functionally identical to removing the
> > > ioctl function, which I think is what should be done here.
> >
> > That is wrong.
> >
> > SuS requires an unknown ioctl code returns -ENOTTY. If the code is
> > currently remapping it to EINVAL then it wants fixing.
>
> Right, I forgot about the EINVAL/ENOTTY difference. The code currently
> returns -ENOIOCTLCMD, which is worse. Thomas' patch makes it return
> -EINVAL, which as you said is still wrong. Removing the ioctl function
> will do the right thing and return -ENOTTY, so that should be done
> here in um/mmapper, with an appropriate changelog.
>
> For the common code in fs/ioctl.c, I think the current behaviour is
> correct. It returns -EINVAL if the driver returns -ENOIOCTLCMD, iow
Only the unlocked_ioctl code path, the locked one returns whatever
crap comes from the ioctl implementation.
> "the request [...] argument is not valid for this device", as specified
> by http://www.opengroup.org/onlinepubs/009695399/functions/ioctl.html.
> Drivers returning ENOIOCTLCMD for every request are broken and should
> be changed to have no ioctl function.
Ack.
tglx
next prev parent reply other threads:[~2009-10-17 2:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-15 8:42 [patch 0/7] BKL the next lot Thomas Gleixner
2009-10-15 8:42 ` [patch 1/7] ia64: Remove the BKL from perfmon Thomas Gleixner
2009-10-15 8:42 ` [patch 2/7] m68k: Remove BKL from rtc implementations Thomas Gleixner
2010-03-07 12:40 ` Geert Uytterhoeven
2009-10-15 8:42 ` [patch 3/7] powerpc: Use unlocked ioctl in nvram_64 Thomas Gleixner
2009-10-15 8:42 ` [patch 4/7] sh: Remove BKL from landisk gio Thomas Gleixner
2009-10-16 6:18 ` Paul Mundt
2009-10-15 8:42 ` [patch 5/7] um: Convert hostaudio to unlocked ioctl Thomas Gleixner
2009-10-15 8:42 ` [patch 6/7] um: Convert mmapper to unlocked_ioctl Thomas Gleixner
2009-10-15 13:00 ` Arnd Bergmann
2009-10-15 14:50 ` Thomas Gleixner
2009-10-15 15:29 ` Alan Cox
2009-10-16 19:42 ` Arnd Bergmann
2009-10-17 2:58 ` Thomas Gleixner [this message]
2009-10-15 8:42 ` [patch 7/7] um: Remove BKL from harddog Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.00.0910170456530.2890@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arndbergmann@googlemail.com \
--cc=fweisbec@gmail.com \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome