linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] drivers: fix up ENOIOCTLCMD error handling
@ 2012-08-27  7:23 Wanlong Gao
  2012-08-27  7:23 ` [PATCH 1/5] drivers:tty:fix " Wanlong Gao
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Wanlong Gao @ 2012-08-27  7:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Wanlong Gao, Linus Torvalds

At this commit,

Cc: Linus Torvalds <torvalds@linux-foundation.org>
commit 07d106d0a33d6063d2061305903deb02489eba20
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Thu Jan 5 15:40:12 2012 -0800

    vfs: fix up ENOIOCTLCMD error handling
    
    We're doing some odd things there, which already messes up various users
    (see the net/socket.c code that this removes), and it was going to add
    yet more crud to the block layer because of the incorrect error code
    translation.
    
    ENOIOCTLCMD is not an error return that should be returned to user mode
    from the "ioctl()" system call, but it should *not* be translated as
    EINVAL ("Invalid argument").  It should be translated as ENOTTY
    ("Inappropriate ioctl for device").
    
    That EINVAL confusion has apparently so permeated some code that the
    block layer actually checks for it, which is sad.  We continue to do so
    for now, but add a big comment about how wrong that is, and we should
    remove it entirely eventually.  In the meantime, this tries to keep the
    changes localized to just the EINVAL -> ENOTTY fix, and removing code
    that makes it harder to do the right thing.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


Linus pointed out that ENOIOCTLCMD should be translated as ENOTTY to user
mode, and we should fix up the broken drivers then.

Wanlong Gao (5):
  drivers:tty:fix up ENOIOCTLCMD error handling
  net:atm:fix up ENOIOCTLCMD error handling
  media:dvb:fix up ENOIOCTLCMD error handling
  video:omap3isp:fix up ENOIOCTLCMD error handling
  s390:block:fix up ENOIOCTLCMD error handling

 drivers/media/dvb/dvb-core/dvbdev.c     |  2 +-
 drivers/media/video/omap3isp/ispvideo.c | 10 +++++-----
 drivers/s390/block/dasd_ioctl.c         |  2 +-
 drivers/tty/tty_io.c                    |  2 +-
 net/atm/resources.c                     |  2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

-- 
1.7.12


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-09-13 10:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-27  7:23 [PATCH 0/5] drivers: fix up ENOIOCTLCMD error handling Wanlong Gao
2012-08-27  7:23 ` [PATCH 1/5] drivers:tty:fix " Wanlong Gao
2012-08-27 22:42   ` Alan Cox
2012-08-27  7:23 ` [PATCH 2/5] net:atm:fix " Wanlong Gao
2012-08-31 20:14   ` David Miller
2012-08-27  7:23 ` [PATCH 3/5] media:dvb:fix " Wanlong Gao
2012-08-27  7:23 ` [PATCH 4/5] video:omap3isp:fix " Wanlong Gao
2012-09-13  4:03   ` Laurent Pinchart
2012-09-13 10:21     ` Wanlong Gao
2012-08-27  7:23 ` [PATCH 5/5] s390:block:fix " Wanlong Gao
2012-08-27  9:03   ` Heiko Carstens
2012-08-27 10:25     ` Stefan Weinhuber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).