diff options
author | Martin Svec <martin.svec@zoner.cz> | 2012-02-07 01:13:25 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-07 01:48:58 -0500 |
commit | 67236c44741e250199ccd77f1115568e68cf8848 (patch) | |
tree | 4b09d2017a0122984b694e167aeaff2afcc931e0 /drivers/target | |
parent | 9f9ef6d3c08319defc29e4cf6ef2868d15ed0cc3 (diff) |
target: Fix unsupported WRITE_SAME sense payload
This patch fixes a bug in target-core where unsupported WRITE_SAME ops
from a target_check_write_same_discard() failure was incorrectly
returning CHECK_CONDITION w/ TCM_INVALID_CDB_FIELD sense data.
This was causing some clients to not properly fall back, so go ahead
and use the correct TCM_UNSUPPORTED_SCSI_OPCODE sense for this case.
Reported-by: Martin Svec <martin.svec@zoner.cz>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_transport.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 799b5efcd382..58cea07b12fb 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -2697,7 +2697,7 @@ static int transport_generic_cmd_sequencer( | |||
2697 | cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB; | 2697 | cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB; |
2698 | 2698 | ||
2699 | if (target_check_write_same_discard(&cdb[10], dev) < 0) | 2699 | if (target_check_write_same_discard(&cdb[10], dev) < 0) |
2700 | goto out_invalid_cdb_field; | 2700 | goto out_unsupported_cdb; |
2701 | if (!passthrough) | 2701 | if (!passthrough) |
2702 | cmd->execute_task = target_emulate_write_same; | 2702 | cmd->execute_task = target_emulate_write_same; |
2703 | break; | 2703 | break; |
@@ -2980,7 +2980,7 @@ static int transport_generic_cmd_sequencer( | |||
2980 | cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB; | 2980 | cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB; |
2981 | 2981 | ||
2982 | if (target_check_write_same_discard(&cdb[1], dev) < 0) | 2982 | if (target_check_write_same_discard(&cdb[1], dev) < 0) |
2983 | goto out_invalid_cdb_field; | 2983 | goto out_unsupported_cdb; |
2984 | if (!passthrough) | 2984 | if (!passthrough) |
2985 | cmd->execute_task = target_emulate_write_same; | 2985 | cmd->execute_task = target_emulate_write_same; |
2986 | break; | 2986 | break; |
@@ -3003,7 +3003,7 @@ static int transport_generic_cmd_sequencer( | |||
3003 | * of byte 1 bit 3 UNMAP instead of original reserved field | 3003 | * of byte 1 bit 3 UNMAP instead of original reserved field |
3004 | */ | 3004 | */ |
3005 | if (target_check_write_same_discard(&cdb[1], dev) < 0) | 3005 | if (target_check_write_same_discard(&cdb[1], dev) < 0) |
3006 | goto out_invalid_cdb_field; | 3006 | goto out_unsupported_cdb; |
3007 | if (!passthrough) | 3007 | if (!passthrough) |
3008 | cmd->execute_task = target_emulate_write_same; | 3008 | cmd->execute_task = target_emulate_write_same; |
3009 | break; | 3009 | break; |