public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: [PATCH] get the kernel to warn about deprecated SCSI ioctls
Date: 19 Aug 2004 12:19:01 -0400	[thread overview]
Message-ID: <1092932342.2378.430.camel@mulgrave> (raw)

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)))



             reply	other threads:[~2004-08-19 16:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-19 16:19 James Bottomley [this message]
2004-08-19 16:21 ` [PATCH] get the kernel to warn about deprecated SCSI ioctls 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1092932342.2378.430.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox