Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls

James Bottomley
2004-08-19T21:06:11Z

On Thu, 2004-08-19 at 12:21, Christoph Hellwig wrote:
> drivers/block/scsi_ioctl.c also implements SCSI_IOCTL_SEND_COMMAND, so
> you'll have to warn there aswell.

Done.

No other places I've missed?

James

===== drivers/block/scsi_ioctl.c 1.53 vs edited =====
--- 1.53/drivers/block/scsi_ioctl.c 2004-08-14 05:24:49 -05:00
+++ edited/drivers/block/scsi_ioctl.c 2004-08-19 15:51:44 -05:00
@@ -510,6 +510,7 @@
* old junk scsi send command ioctl
*/
case SCSI_IOCTL_SEND_COMMAND:
+ printk(KERN_WARNING "program %s is using a deprecated SCSI ioctl, please convert it to SG_IO\n", current->comm);
err = -EINVAL;
if (!arg)
break;
===== drivers/scsi/scsi_ioctl.c 1.28 vs edited =====
--- 1.28/drivers/scsi/scsi_ioctl.c 2004-06-26 17:40:24 -05:00
+++ edited/drivers/scsi/scsi_ioctl.c 2004-08-19 09:45:22 -05:00
@@ -391,6 +391,21 @@
if (!scsi_block_when_processing_errors(sdev))
return -ENODEV;

+ /* Check for deprecated ioctls ... all the ioctls which don't
+ * follow the new unique numbering scheme are deprecated */
+ switch (cmd) {
+ case SCSI_IOCTL_SEND_COMMAND:
+ case SCSI_IOCTL_TEST_UNIT_READY:
+ case SCSI_IOCTL_BENCHMARK_COMMAND:
+ case SCSI_IOCTL_SYNC:
+ case SCSI_IOCTL_START_UNIT:
+ case SCSI_IOCTL_STOP_UNIT:
+ printk(KERN_WARNING "program %s is using a deprecated SCSI ioctl, please convert it to SG_IO\n", current->comm);
+ break;
+ default:
+ break;
+ }
+
switch (cmd) {
case SCSI_IOCTL_GET_IDLUN:
if (verify_area(VERIFY_WRITE, arg, sizeof(struct scsi_idlun)))