get the kernel to warn about deprecated SCSI ioctls
Subsystems (2)
PATCH 1/1 get the kernel to warn about deprecated SCSI ioctls
The non unique SCSI ioctls:
SCSI_IOCTL_SEND_COMMANDSCSI_IOCTL_TEST_UNIT_READYSCSI_IOCTL_BENCHMARK_COMMANDSCSI_IOCTL_SYNCSCSI_IOCTL_START_UNITSCSI_IOCTL_STOP_UNIT
Have been deprecated for a while now. We should make the kernel complain when a program actually uses one of them, so users have had adequate warning before they are removed.
James
===== drivers/scsi/scsi_ioctl.c 1.28 vs edited =====
drivers/scsi/scsi_ioctl.c +15 -0
@@ -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 )))
Quoted 9 lines · James Bottomley
The non unique SCSI ioctls:
SCSI_IOCTL_SEND_COMMANDSCSI_IOCTL_TEST_UNIT_READYSCSI_IOCTL_BENCHMARK_COMMANDSCSI_IOCTL_SYNCSCSI_IOCTL_START_UNITSCSI_IOCTL_STOP_UNIT
Quoted 3 lines
Have been deprecated for a while now. We should make the kernel complain when a program actually uses one of them, so users have had adequate warning before they are removed.
drivers/block/scsi_ioctl.c also implements SCSI_IOCTL_SEND_COMMAND, so you'll have to warn there aswell.
Quoted 2 lines · Christoph Hellwig
drivers/block/scsi_ioctl.calso implementsSCSI_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 =====
drivers/block/scsi_ioctl.c +1 -0
@@ -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 =====
drivers/scsi/scsi_ioctl.c +15 -0
@@ -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 )))
Quoted 9 lines · James Bottomley
The non unique SCSI ioctls:
SCSI_IOCTL_SEND_COMMANDSCSI_IOCTL_TEST_UNIT_READYSCSI_IOCTL_BENCHMARK_COMMANDSCSI_IOCTL_SYNCSCSI_IOCTL_START_UNITSCSI_IOCTL_STOP_UNIT
Quoted 3 lines
Have been deprecated for a while now. We should make the kernel complain when a program actually uses one of them, so users have had adequate warning before they are removed.
any chance of deprecating the doorlock ioctls too?
Jeff
Quoted 10 lines · Jeff Garzik
Quoted 9 lines · James Bottomley
The non unique SCSI ioctls:
SCSI_IOCTL_SEND_COMMANDSCSI_IOCTL_TEST_UNIT_READYSCSI_IOCTL_BENCHMARK_COMMANDSCSI_IOCTL_SYNCSCSI_IOCTL_START_UNITSCSI_IOCTL_STOP_UNIT
Quoted 5 lines
Quoted 3 lines
Have been deprecated for a while now. We should make the kernel complain when a program actually uses one of them, so users have had adequate warning before they are removed.
any chance of deprecating the doorlock ioctls too?
The doorlock ones are unique, and are used by some of the CD tools.
We really need to know when an app locks the door rather than having to scan the commands in SG_IO.
James
Quoted 17 lines · James Bottomley
Quoted 15 lines · Jeff Garzik
Quoted 12 lines · James Bottomley
The non unique SCSI ioctls:
SCSI_IOCTL_SEND_COMMANDSCSI_IOCTL_TEST_UNIT_READYSCSI_IOCTL_BENCHMARK_COMMANDSCSI_IOCTL_SYNCSCSI_IOCTL_START_UNITSCSI_IOCTL_STOP_UNITHave been deprecated for a while now. We should make the kernel complain when a program actually uses one of them, so users have had adequate warning before they are removed.
Quoted 7 lines
Quoted 1 line
any chance of deprecating the doorlock ioctls too?
The doorlock ones are unique, and are used by some of the CD tools.
We really need to know when an app locks the door rather than having to scan the commands in
SG_IO.
You need to scan the commands in SG_IO anyway, otherwise you do not know in all cases when an app locks the door :)
Jeff
Quoted 9 lines · James Bottomley
The non unique SCSI ioctls:
SCSI_IOCTL_SEND_COMMANDSCSI_IOCTL_TEST_UNIT_READYSCSI_IOCTL_BENCHMARK_COMMANDSCSI_IOCTL_SYNCSCSI_IOCTL_START_UNITSCSI_IOCTL_STOP_UNIT
Quoted 3 lines
Have been deprecated for a while now. We should make the kernel complain when a program actually uses one of them, so users have had adequate warning before they are removed.
James,
[Wearing my smartmontools maintainer hat] such a change is going to cause a lot of noise in the log from the smartd daemon. The code to use SG_IO ioctl in smartmontools is in CVS but won't be released for a month or so.
If they are not going to be dropped in the lk 2.6 series why not wait until the lk 2.7 development starts (or late lk 2.6 series)?
Doug Gilbert
Quoted 8 lines · Douglas Gilbert
[Wearing my smartmontools maintainer hat] such a change is going to cause a lot of noise in the log from the smartd daemon. The code to use
SG_IOioctl in smartmontools is in CVS but won't be released for a month or so.If they are not going to be dropped in the lk 2.6 series why not wait until the lk 2.7 development starts (or late lk 2.6 series)?
The current issue is that some of them have no compat code, so they don't actually work 32 on 64.
If the noise becomes unbearable, we can rate limit it, but I'd like to get the message out.
James