From: Alan Cox <alan@redhat.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: PATCH: fix block layer ioctl bug
Date: Wed, 12 May 2004 17:40:06 -0400 [thread overview]
Message-ID: <20040512214006.GA25117@devserv.devel.redhat.com> (raw)
The block layer checks for -EINVAL from block layer driver ioctls. This
is wrong - ENOTTY is unknown and some drivers correctly use this. I suspect
for an internal ioctl 2.7 should change to -ENOIOCTLCMD and bitch about
old style returns
This is conservative fix for the 2.6 case, it keeps the bogus -EINVAL to
avoid breaking stuff
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.6/drivers/block/ioctl.c linux-2.6.6/drivers/block/ioctl.c
--- linux.vanilla-2.6.6/drivers/block/ioctl.c 2004-05-10 03:31:59.000000000 +0100
+++ linux-2.6.6/drivers/block/ioctl.c 2004-05-11 20:05:09.000000000 +0100
@@ -203,7 +203,8 @@
case BLKROSET:
if (disk->fops->ioctl) {
ret = disk->fops->ioctl(inode, file, cmd, arg);
- if (ret != -EINVAL)
+ /* -EINVAL to handle old uncorrected drivers */
+ if (ret != -EINVAL && ret != -ENOTTY)
return ret;
}
if (!capable(CAP_SYS_ADMIN))
next reply other threads:[~2004-05-12 21:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-12 21:40 Alan Cox [this message]
[not found] <1V9VL-3ty-5@gated-at.bofh.it>
2004-10-01 13:56 ` PATCH: fix block layer ioctl bug Ed L Cashin
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=20040512214006.GA25117@devserv.devel.redhat.com \
--to=alan@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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