Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -5
+5 -5
drivers/ide/ide.c
··· 1049 1049 unsigned long flags; 1050 1050 ide_driver_t *drv; 1051 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 1053 u8 *val; 1054 - 1055 - err = scsi_cmd_ioctl(file, bdev->bd_disk->queue, bdev->bd_disk, cmd, p); 1056 - if (err != -ENOTTY) 1057 - return err; 1058 1054 1059 1055 switch (cmd) { 1060 1056 case HDIO_GET_32BIT: val = &drive->io_32bit; goto read_val; ··· 1170 1174 1171 1175 return 0; 1172 1176 } 1177 + 1178 + case CDROMEJECT: 1179 + case CDROMCLOSETRAY: 1180 + return scsi_cmd_ioctl(file, bdev->bd_disk->queue, bdev->bd_disk, cmd, p); 1173 1181 1174 1182 case HDIO_GET_BUSSTATE: 1175 1183 if (!capable(CAP_SYS_ADMIN))