This is a note to let you know that I've just added the patch titled

    target: Correct sense key for INVALID FIELD IN {PARAMETER LIST,CDB}

to the 3.2-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     target-correct-sense-key-for-invalid-field-in-parameter-list-cdb.patch
and it can be found in the queue-3.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 9fbc8909876a2160044e71d376848973b9bfdc3f Mon Sep 17 00:00:00 2001
From: Roland Dreier <[email protected]>
Date: Mon, 9 Jan 2012 17:54:00 -0800
Subject: target: Correct sense key for INVALID FIELD IN {PARAMETER LIST,CDB}

From: Roland Dreier <[email protected]>

commit 9fbc8909876a2160044e71d376848973b9bfdc3f upstream.

According to SPC-4, the sense key for commands that are failed with
INVALID FIELD IN PARAMETER LIST and INVALID FIELD IN CDB should be
ILLEGAL REQUEST (5h) rather than ABORTED COMMAND (Bh).  Without this
patch, a tcm_loop LUN incorrectly gives:

    # sg_raw -r 1 -v /dev/sda 3 1 0 0 ff 0
    Sense Information:
     Fixed format, current;  Sense key: Aborted Command
     Additional sense: Invalid field in cdb
     Raw sense data (in hex):
            70 00 0b 00 00 00 00 0a  00 00 00 00 24 00 00 00
            00 00

While a real SCSI disk gives:

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
     Additional sense: Invalid field in cdb
     Raw sense data (in hex):
            70 00 05 00 00 00 00 18  00 00 00 00 24 00 00 00
            00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00

with the main point being that the real disk gives a sense key of
ILLEGAL REQUEST (5h).

Signed-off-by: Roland Dreier <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/target/target_core_transport.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -4403,8 +4403,8 @@ int transport_send_check_condition_and_s
                /* CURRENT ERROR */
                buffer[offset] = 0x70;
                buffer[offset+SPC_ADD_SENSE_LEN_OFFSET] = 10;
-               /* ABORTED COMMAND */
-               buffer[offset+SPC_SENSE_KEY_OFFSET] = ABORTED_COMMAND;
+               /* ILLEGAL REQUEST */
+               buffer[offset+SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST;
                /* INVALID FIELD IN CDB */
                buffer[offset+SPC_ASC_KEY_OFFSET] = 0x24;
                break;
@@ -4412,8 +4412,8 @@ int transport_send_check_condition_and_s
                /* CURRENT ERROR */
                buffer[offset] = 0x70;
                buffer[offset+SPC_ADD_SENSE_LEN_OFFSET] = 10;
-               /* ABORTED COMMAND */
-               buffer[offset+SPC_SENSE_KEY_OFFSET] = ABORTED_COMMAND;
+               /* ILLEGAL REQUEST */
+               buffer[offset+SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST;
                /* INVALID FIELD IN PARAMETER LIST */
                buffer[offset+SPC_ASC_KEY_OFFSET] = 0x26;
                break;


Patches currently in stable-queue which might be from [email protected] are

queue-3.2/target-allow-persistent-reserve-in-for-non-reservation-holder.patch
queue-3.2/target-correct-sense-key-for-invalid-field-in-parameter-list-cdb.patch
queue-3.2/target-return-correct-asc-for-unimplemented-vpd-pages.patch
queue-3.2/target-add-workaround-for-zero-length-control-cdb-handling.patch
queue-3.2/target-fail-inquiry-commands-with-evpd-0-but-page-code-0.patch
queue-3.2/target-use-correct-preempted-registration-sense-code.patch
queue-3.2/ib-mlx4-pass-smp-vendor-specific-attribute-mads-to-firmware.patch
queue-3.2/rdma-core-fix-kernel-panic-by-always-initializing-qp-usecnt.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to