lkml.org 
[lkml]   [2000]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date

My major comment is that you should use "SEND_DIAGNOSTIC" instead of a
hardcoded 0x1d.

-Eric

----- Original Message -----
From: <Matt_Domsch@Dell.com>
To: <linux-scsi@vger.kernel.org>; <linux-kernel@vger.kernel.org>;
<torvalds@transmeta.com>; <alan@redhat.com>
Cc: <Michael_Landrus@Dell.com>
Sent: Monday, September 18, 2000 12:31 PM
Subject: [PATCH] scsi_ioctl_send_command() shouldn't write SEND DIAGNOSTICS
reserved bits

> 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-scsi" in
> the body of a message to majordomo@vger.kernel.org
>

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

\
 
 \ /
  Last update: 2005-03-22 12:38    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean