public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [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 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