public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: fix block layer ioctl bug
@ 2004-05-12 21:40 Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2004-05-12 21:40 UTC (permalink / raw)
  To: akpm, linux-kernel

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))

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

end of thread, other threads:[~2004-10-01 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1V9VL-3ty-5@gated-at.bofh.it>
2004-10-01 13:56 ` PATCH: fix block layer ioctl bug Ed L Cashin
2004-05-12 21:40 Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox