aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 18:57:42 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 18:57:42 -0400
commit1985026d32e69ed6dac3ba0ef8ff10366f060ed3 (patch)
treea355fde028462c4d6ae6cad9090011a73cb566a7 /drivers/ide
parent8b0d4164b4ac151050953d78c97fcceade69eb3c (diff)
Revert drivers/ide/ide.c scsi_cmd_ioctl() usage changes
The old IDE driver is not ready to take generic SCSI commands, even if it uses them for some specific issues (ie the tray open/close ioctls for IDE CD-ROM's). Pointed out by Bartlomiej. I'm sure we'll have it fixed properly soon enough, but for now we should not allow it to cause problems. Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 8cd7694593c9..077fb674a96d 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1049,13 +1049,9 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1049 unsigned long flags; 1049 unsigned long flags;
1050 ide_driver_t *drv; 1050 ide_driver_t *drv;
1051 void __user *p = (void __user *)arg; 1051 void __user *p = (void __user *)arg;
1052 int err, (*setfunc)(ide_drive_t *, int); 1052 int err = 0, (*setfunc)(ide_drive_t *, int);
1053 u8 *val; 1053 u8 *val;
1054 1054
1055 err = scsi_cmd_ioctl(file, bdev->bd_disk->queue, bdev->bd_disk, cmd, p);
1056 if (err != -ENOTTY)
1057 return err;
1058
1059 switch (cmd) { 1055 switch (cmd) {
1060 case HDIO_GET_32BIT: val = &drive->io_32bit; goto read_val; 1056 case HDIO_GET_32BIT: val = &drive->io_32bit; goto read_val;
1061 case HDIO_GET_KEEPSETTINGS: val = &drive->keep_settings; goto read_val; 1057 case HDIO_GET_KEEPSETTINGS: val = &drive->keep_settings; goto read_val;
@@ -1175,6 +1171,10 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1175 return 0; 1171 return 0;
1176 } 1172 }
1177 1173
1174 case CDROMEJECT:
1175 case CDROMCLOSETRAY:
1176 return scsi_cmd_ioctl(file, bdev->bd_disk->queue, bdev->bd_disk, cmd, p);
1177
1178 case HDIO_GET_BUSSTATE: 1178 case HDIO_GET_BUSSTATE:
1179 if (!capable(CAP_SYS_ADMIN)) 1179 if (!capable(CAP_SYS_ADMIN))
1180 return -EACCES; 1180 return -EACCES;