diff mbox

[v4,5/5] target: Return ABORTED_COMMAND sense key for PI errors

Message ID 1436367534-15995-6-git-send-email-sagig@mellanox.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sagi Grimberg July 8, 2015, 2:58 p.m. UTC
PI errors were reported with ILLEGAL_REQUEST sense key but
there was actually no problem with the request. Target
detected PI errors should be reported with aborted command
sense key.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/target/target_core_transport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Hannes Reinecke July 8, 2015, 3:07 p.m. UTC | #1
On 07/08/2015 04:58 PM, Sagi Grimberg wrote:
> PI errors were reported with ILLEGAL_REQUEST sense key but
> there was actually no problem with the request. Target
> detected PI errors should be reported with aborted command
> sense key.
> 
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> ---
>  drivers/target/target_core_transport.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
> index 923e69d..1847fdc 100644
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -2705,19 +2705,19 @@ static const struct sense_info sense_info_table[] = {
>  		.ascq = 0x00,
>  	},
>  	[TCM_LOGICAL_BLOCK_GUARD_CHECK_FAILED] = {
> -		.key = ILLEGAL_REQUEST,
> +		.key = ABORTED_COMMAND,
>  		.asc = 0x10,
>  		.ascq = 0x01, /* LOGICAL BLOCK GUARD CHECK FAILED */
>  		.add_sector_info = true,
>  	},
>  	[TCM_LOGICAL_BLOCK_APP_TAG_CHECK_FAILED] = {
> -		.key = ILLEGAL_REQUEST,
> +		.key = ABORTED_COMMAND,
>  		.asc = 0x10,
>  		.ascq = 0x02, /* LOGICAL BLOCK APPLICATION TAG CHECK FAILED */
>  		.add_sector_info = true,
>  	},
>  	[TCM_LOGICAL_BLOCK_REF_TAG_CHECK_FAILED] = {
> -		.key = ILLEGAL_REQUEST,
> +		.key = ABORTED_COMMAND,
>  		.asc = 0x10,
>  		.ascq = 0x03, /* LOGICAL BLOCK REFERENCE TAG CHECK FAILED */
>  		.add_sector_info = true,
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Martin K. Petersen July 9, 2015, 4:21 p.m. UTC | #2
>>>>> "Sagi" == Sagi Grimberg <sagig@mellanox.com> writes:

Sagi> PI errors were reported with ILLEGAL_REQUEST sense key but there
Sagi> was actually no problem with the request. Target detected PI
Sagi> errors should be reported with aborted command sense key.

For legacy reasons we use ILLEGAL REQUEST with the same ASC/ASCQ to
signal errors detected by the initiator. The target should always use
ABORTED COMMAND.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
diff mbox

Patch

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 923e69d..1847fdc 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2705,19 +2705,19 @@  static const struct sense_info sense_info_table[] = {
 		.ascq = 0x00,
 	},
 	[TCM_LOGICAL_BLOCK_GUARD_CHECK_FAILED] = {
-		.key = ILLEGAL_REQUEST,
+		.key = ABORTED_COMMAND,
 		.asc = 0x10,
 		.ascq = 0x01, /* LOGICAL BLOCK GUARD CHECK FAILED */
 		.add_sector_info = true,
 	},
 	[TCM_LOGICAL_BLOCK_APP_TAG_CHECK_FAILED] = {
-		.key = ILLEGAL_REQUEST,
+		.key = ABORTED_COMMAND,
 		.asc = 0x10,
 		.ascq = 0x02, /* LOGICAL BLOCK APPLICATION TAG CHECK FAILED */
 		.add_sector_info = true,
 	},
 	[TCM_LOGICAL_BLOCK_REF_TAG_CHECK_FAILED] = {
-		.key = ILLEGAL_REQUEST,
+		.key = ABORTED_COMMAND,
 		.asc = 0x10,
 		.ascq = 0x03, /* LOGICAL BLOCK REFERENCE TAG CHECK FAILED */
 		.add_sector_info = true,