All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bodo Stroesser <bstroesser@ts.fujitsu.com>
To: target-devel@vger.kernel.org
Subject: [PATCH] target: do not overwrite CDB byte 1
Date: Mon, 14 Oct 2019 18:29:04 +0000	[thread overview]
Message-ID: <12498eab-76fd-eaad-1316-c2827badb76a@ts.fujitsu.com> (raw)

passthrough_parse_cdb() - used by TCMU and PSCSI - attepts to
reset the LUN field of SCSI-2 CDBs (bits 5,6,7 of byte 1).
The current code is wrong, as for newer commands not having the
LUN field it overwrites relevant command bits (e.g. for SECURITY
PROTOCOL IN / OUT)
We think this code was unnecessary from the beginning or at least
it is no longer useful. So we remove it entirely.

Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
---
  drivers/target/target_core_device.c |   21 ---------------------
  1 file changed, 21 deletions(-)

--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -1075,27 +1075,6 @@ passthrough_parse_cdb(struct se_cmd *cmd
  	unsigned int size;
   	/*
-	 * Clear a lun set in the cdb if the initiator talking to use spoke
-	 * and old standards version, as we can't assume the underlying device
-	 * won't choke up on it.
-	 */
-	switch (cdb[0]) {
-	case READ_10: /* SBC - RDProtect */
-	case READ_12: /* SBC - RDProtect */
-	case READ_16: /* SBC - RDProtect */
-	case SEND_DIAGNOSTIC: /* SPC - SELF-TEST Code */
-	case VERIFY: /* SBC - VRProtect */
-	case VERIFY_16: /* SBC - VRProtect */
-	case WRITE_VERIFY: /* SBC - VRProtect */
-	case WRITE_VERIFY_12: /* SBC - VRProtect */
-	case MAINTENANCE_IN: /* SPC - Parameter Data Format for SA RTPG */
-		break;
-	default:
-		cdb[1] &= 0x1f; /* clear logical unit number */
-		break;
-	}
-
-	/*
  	 * For REPORT LUNS we always need to emulate the response, for everything
  	 * else, pass it up.
  	 */

             reply	other threads:[~2019-10-14 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 18:29 Bodo Stroesser [this message]
2019-10-14 21:51 ` [PATCH] target: do not overwrite CDB byte 1 Bart Van Assche
2019-10-15  5:59 ` Hannes Reinecke
2019-10-18  1:41 ` Martin K. Petersen

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=12498eab-76fd-eaad-1316-c2827badb76a@ts.fujitsu.com \
    --to=bstroesser@ts.fujitsu.com \
    --cc=target-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.