lkml.org 
[lkml]   [2004]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: fix block layer ioctl bug
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))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.021 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site