This patch prevents scsi_ioctl_send_command() from overwriting the SEND
DIAGNOSTICS (Drive Self Test) reserved bits in cmd[1], as found in SCSI-3.
Code provided by Michael Landrus of Dell.

Comments are requested.  If there are no objections, Linus and Alan please
apply.
Below are patches to kernels 2.2.18-pre8 and 2.4.0-test9-pre1.

Thanks,
Matt Domsch
Dell Enterprise Systems Group
Linux Development Team

--- 2.2.18-pre8-linux/drivers/scsi/scsi_ioctl.c.orig    Mon Sep 18 07:47:45
2000
+++ 2.2.18-pre8-linux/drivers/scsi/scsi_ioctl.c Mon Sep 18 07:48:29 2000
@@ -254,7 +254,8 @@
     /*
      * Set the lun field to the correct value.
      */
-    cmd[1] = ( cmd[1] & 0x1f ) | (dev->lun << 5);
+    if ( cmd[0] != 0x1d )  // don't overwrite the SCSI-3 SEND DIAGNOSTICS
reserved bits
+      cmd[1] = (cmd[1] & 0x1f) | (dev->lun << 5);
     
     switch (opcode)
       {


--- 2.4.0-test9-pre1-linux/drivers/scsi/scsi_ioctl.c.orig       Mon Sep 18
07:37:36 2000
+++ 2.4.0-test9-pre1-linux/drivers/scsi/scsi_ioctl.c    Mon Sep 18 07:41:36
2000
@@ -266,7 +266,8 @@
        /*
         * Set the lun field to the correct value.
         */
-       cmd[1] = (cmd[1] & 0x1f) | (dev->lun << 5);
+       if ( cmd[0] != 0x1d )  // don't overwrite the SCSI-3 SEND
DIAGNOSTICS reserved bits
+          cmd[1] = (cmd[1] & 0x1f) | (dev->lun << 5);
 
        switch (opcode) {
        case FORMAT_UNIT:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to