aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorBernhard Kohl <bernhard.kohl@nsn.com>2012-10-24 09:53:58 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-10-26 19:49:40 -0400
commit1a1ff38c4cebf23be8bf0009a76b082a13bd25cb (patch)
treec8ad4d540b5a2ba2e5b6b3ae12694ab68c092505 /drivers/target
parente13d5fef88c40b87c8430f8274c3a9ca32ef90bc (diff)
target: reintroduce some obsolete SCSI-2 commands
With kernel 3.6 some obsolete SCSI-2 commands including SEEK_10 have have been removed by commit 1fd032ee10d2816c947f5d5b9abda95e728f0a8f "target: move code for CDB emulation". There are still clients out there which use these old SCSI-2 commands. This mainly happens when running VMs with legacy guest systems, connected via SCSI command pass-through to iSCSI targets. Make them happy and return status GOOD. Many real SCSI disks or external iSCSI storage devices still support these old commands. So let's make LIO backward compatible as well. This patch adds support for the previously removed SEEK_10 and additionally the SEEK_6 and REZERO_UNIT commands. Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_sbc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index 868f8aa04f13..a6e27d967c7b 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -135,6 +135,12 @@ static int sbc_emulate_verify(struct se_cmd *cmd)
135 return 0; 135 return 0;
136} 136}
137 137
138static int sbc_emulate_noop(struct se_cmd *cmd)
139{
140 target_complete_cmd(cmd, GOOD);
141 return 0;
142}
143
138static inline u32 sbc_get_size(struct se_cmd *cmd, u32 sectors) 144static inline u32 sbc_get_size(struct se_cmd *cmd, u32 sectors)
139{ 145{
140 return cmd->se_dev->se_sub_dev->se_dev_attrib.block_size * sectors; 146 return cmd->se_dev->se_sub_dev->se_dev_attrib.block_size * sectors;
@@ -531,6 +537,18 @@ int sbc_parse_cdb(struct se_cmd *cmd, struct spc_ops *ops)
531 size = 0; 537 size = 0;
532 cmd->execute_cmd = sbc_emulate_verify; 538 cmd->execute_cmd = sbc_emulate_verify;
533 break; 539 break;
540 case REZERO_UNIT:
541 case SEEK_6:
542 case SEEK_10:
543 /*
544 * There are still clients out there which use these old SCSI-2
545 * commands. This mainly happens when running VMs with legacy
546 * guest systems, connected via SCSI command pass-through to
547 * iSCSI targets. Make them happy and return status GOOD.
548 */
549 size = 0;
550 cmd->execute_cmd = sbc_emulate_noop;
551 break;
534 default: 552 default:
535 ret = spc_parse_cdb(cmd, &size); 553 ret = spc_parse_cdb(cmd, &size);
536 if (ret) 554 if (ret)