* [PATCH] get the kernel to warn about deprecated SCSI ioctls
@ 2004-08-19 16:19 James Bottomley
2004-08-19 16:21 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: James Bottomley @ 2004-08-19 16:19 UTC (permalink / raw)
To: SCSI Mailing List
The non unique SCSI ioctls:
SCSI_IOCTL_SEND_COMMAND
SCSI_IOCTL_TEST_UNIT_READY
SCSI_IOCTL_BENCHMARK_COMMAND
SCSI_IOCTL_SYNC
SCSI_IOCTL_START_UNIT
SCSI_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 =====
--- 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)))
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls
2004-08-19 16:19 [PATCH] get the kernel to warn about deprecated SCSI ioctls James Bottomley
@ 2004-08-19 16:21 ` Christoph Hellwig
2004-08-19 21:06 ` James Bottomley
2004-08-19 16:23 ` Jeff Garzik
2004-08-19 22:18 ` Douglas Gilbert
2 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2004-08-19 16:21 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI Mailing List
On Thu, Aug 19, 2004 at 12:19:01PM -0400, James Bottomley wrote:
> The non unique SCSI ioctls:
>
> SCSI_IOCTL_SEND_COMMAND
> SCSI_IOCTL_TEST_UNIT_READY
> SCSI_IOCTL_BENCHMARK_COMMAND
> SCSI_IOCTL_SYNC
> SCSI_IOCTL_START_UNIT
> SCSI_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.
drivers/block/scsi_ioctl.c also implements SCSI_IOCTL_SEND_COMMAND, so
you'll have to warn there aswell.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls
2004-08-19 16:21 ` Christoph Hellwig
@ 2004-08-19 21:06 ` James Bottomley
0 siblings, 0 replies; 9+ messages in thread
From: James Bottomley @ 2004-08-19 21:06 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: SCSI Mailing List
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)))
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls
2004-08-19 16:19 [PATCH] get the kernel to warn about deprecated SCSI ioctls James Bottomley
2004-08-19 16:21 ` Christoph Hellwig
@ 2004-08-19 16:23 ` Jeff Garzik
2004-08-19 16:28 ` James Bottomley
2004-08-19 22:18 ` Douglas Gilbert
2 siblings, 1 reply; 9+ messages in thread
From: Jeff Garzik @ 2004-08-19 16:23 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI Mailing List
On Thu, Aug 19, 2004 at 12:19:01PM -0400, James Bottomley wrote:
> The non unique SCSI ioctls:
>
> SCSI_IOCTL_SEND_COMMAND
> SCSI_IOCTL_TEST_UNIT_READY
> SCSI_IOCTL_BENCHMARK_COMMAND
> SCSI_IOCTL_SYNC
> SCSI_IOCTL_START_UNIT
> SCSI_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.
any chance of deprecating the doorlock ioctls too?
Jeff
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls
2004-08-19 16:23 ` Jeff Garzik
@ 2004-08-19 16:28 ` James Bottomley
2004-08-19 16:41 ` Jeff Garzik
0 siblings, 1 reply; 9+ messages in thread
From: James Bottomley @ 2004-08-19 16:28 UTC (permalink / raw)
To: Jeff Garzik; +Cc: SCSI Mailing List
On Thu, 2004-08-19 at 12:23, Jeff Garzik wrote:
> On Thu, Aug 19, 2004 at 12:19:01PM -0400, James Bottomley wrote:
> > The non unique SCSI ioctls:
> >
> > SCSI_IOCTL_SEND_COMMAND
> > SCSI_IOCTL_TEST_UNIT_READY
> > SCSI_IOCTL_BENCHMARK_COMMAND
> > SCSI_IOCTL_SYNC
> > SCSI_IOCTL_START_UNIT
> > SCSI_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.
>
> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls
2004-08-19 16:28 ` James Bottomley
@ 2004-08-19 16:41 ` Jeff Garzik
0 siblings, 0 replies; 9+ messages in thread
From: Jeff Garzik @ 2004-08-19 16:41 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI Mailing List
James Bottomley wrote:
> On Thu, 2004-08-19 at 12:23, Jeff Garzik wrote:
>
>>On Thu, Aug 19, 2004 at 12:19:01PM -0400, James Bottomley wrote:
>>
>>>The non unique SCSI ioctls:
>>>
>>>SCSI_IOCTL_SEND_COMMAND
>>>SCSI_IOCTL_TEST_UNIT_READY
>>>SCSI_IOCTL_BENCHMARK_COMMAND
>>>SCSI_IOCTL_SYNC
>>>SCSI_IOCTL_START_UNIT
>>>SCSI_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.
>>
>>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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls
2004-08-19 16:19 [PATCH] get the kernel to warn about deprecated SCSI ioctls James Bottomley
2004-08-19 16:21 ` Christoph Hellwig
2004-08-19 16:23 ` Jeff Garzik
@ 2004-08-19 22:18 ` Douglas Gilbert
2004-08-19 22:27 ` James Bottomley
2 siblings, 1 reply; 9+ messages in thread
From: Douglas Gilbert @ 2004-08-19 22:18 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI Mailing List
James Bottomley wrote:
> The non unique SCSI ioctls:
>
> SCSI_IOCTL_SEND_COMMAND
> SCSI_IOCTL_TEST_UNIT_READY
> SCSI_IOCTL_BENCHMARK_COMMAND
> SCSI_IOCTL_SYNC
> SCSI_IOCTL_START_UNIT
> SCSI_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,
[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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls
2004-08-19 22:18 ` Douglas Gilbert
@ 2004-08-19 22:27 ` James Bottomley
0 siblings, 0 replies; 9+ messages in thread
From: James Bottomley @ 2004-08-19 22:27 UTC (permalink / raw)
To: Douglas Gilbert; +Cc: SCSI Mailing List
On Thu, 2004-08-19 at 18:18, Douglas Gilbert wrote:
> [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)?
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] get the kernel to warn about deprecated SCSI ioctls
@ 2004-08-19 17:06 Pat LaVarre
0 siblings, 0 replies; 9+ messages in thread
From: Pat LaVarre @ 2004-08-19 17:06 UTC (permalink / raw)
To: linux-scsi
Yes, please, which SCSI pass thru ioctl should I use in Linux.
> SCSI_IOCTL_SEND_COMMAND ...
> please convert ... to SG_IO
Ouch, I am instead choosing the mostly undocumented ioctl
CDROM_SEND_PACKET, opened O_NONBLOCK, because I can't see how else to
reach 2.4 Linux /dev/hd$v thru cdrom ide-cd.
> SCSI_IOCTL_SEND_COMMAND ... deprecated ...
Me the newbie, I missed and I still do not see how I should know this
SCSI pass thru ioctl is deprecated, unless we add the printk you
suggest.
Pat LaVarre
http://marc.theaimsgroup.com/?l=linux-scsi&m=109278095826988
http://linux-pel.blog-city.com/read/756175.htm
http://linux-pel.blog-city.com/read/771746.htm
P.S. I'm resorting to SCSI pass thru for such purposes as toggling the
invisible MMC PWP write protect switch found in DVD-RAM discs, Iomega
REV discs, etc.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-08-19 22:27 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-19 16:19 [PATCH] get the kernel to warn about deprecated SCSI ioctls James Bottomley
2004-08-19 16:21 ` Christoph Hellwig
2004-08-19 21:06 ` James Bottomley
2004-08-19 16:23 ` Jeff Garzik
2004-08-19 16:28 ` James Bottomley
2004-08-19 16:41 ` Jeff Garzik
2004-08-19 22:18 ` Douglas Gilbert
2004-08-19 22:27 ` James Bottomley
-- strict thread matches above, loose matches on Subject: below --
2004-08-19 17:06 Pat LaVarre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox