diff mbox

If the list ID is not supported, return TCM_UNSUPPORTED_SCSI_OPCODE

Message ID 87df14ed-c47a-4186-db6e-ab4f96135416@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jiang Yi July 10, 2017, 8:45 a.m. UTC
Hi Nic,

To pass the "SCSI.ReceiveCopyResults.CopyStatus" test case of libiscsi test suite:

./libiscsi/test-tool/iscsi-test-cu --test=SCSI.ReceiveCopyResults.CopyStatus --verbose --Verbose-scsi --dataloss 
iscsi://${IP}:3260/${IQN}/0

I propose a patch:

Signed-off-by: Jiang Yi <jiangyilism@gmail.com>
---
 drivers/target/target_core_xcopy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicholas A. Bellinger July 30, 2017, 9:33 p.m. UTC | #1
Hi Jiang,

On Mon, 2017-07-10 at 16:45 +0800, Jiang Yi wrote:
> Hi Nic,
> 
> To pass the "SCSI.ReceiveCopyResults.CopyStatus" test case of libiscsi test suite:
> 
> ./libiscsi/test-tool/iscsi-test-cu --test=SCSI.ReceiveCopyResults.CopyStatus --verbose --Verbose-scsi --dataloss 
> iscsi://${IP}:3260/${IQN}/0
> 
> I propose a patch:
> 
> Signed-off-by: Jiang Yi <jiangyilism@gmail.com>
> ---
>  drivers/target/target_core_xcopy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
> index cac5a20..8654b10 100644
> --- a/drivers/target/target_core_xcopy.c
> +++ b/drivers/target/target_core_xcopy.c
> @@ -1091,7 +1091,7 @@ sense_reason_t target_do_receive_copy_results(struct se_cmd *se_cmd)
>  	if (list_id != 0) {
>  		pr_err("Receive Copy Results with non zero list identifier"
>  		       " not supported\n");
> -		return TCM_INVALID_CDB_FIELD;
> +		return TCM_UNSUPPORTED_SCSI_OPCODE;
>  	}
>  
>  	switch (sa) {

According to SPC-4, this libiscsi test looks incorrect.

From 6.21 RECEIVE COPY DATA(LID1) command:

The RECEIVE COPY DATA(LID1) command shall be terminated with CHECK
CONDITION status, with the sense key set to ILLEGAL REQUEST, and the
additional sense code set INVALID FIELD IN CDB if:

     a) no copy operation known to the copy manager has a list 
        identifier that matches the LIST IDENTIFIER field in the CDB; or
     b) if the LIST IDENTIFIER field in the CDB specifies a copy 
        operation that still is being processed by the copy manager.

So this case above returning TCM_INVALID_CDB_FIELD with be a).



--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
index cac5a20..8654b10 100644
--- a/drivers/target/target_core_xcopy.c
+++ b/drivers/target/target_core_xcopy.c
@@ -1091,7 +1091,7 @@  sense_reason_t target_do_receive_copy_results(struct se_cmd *se_cmd)
 	if (list_id != 0) {
 		pr_err("Receive Copy Results with non zero list identifier"
 		       " not supported\n");
-		return TCM_INVALID_CDB_FIELD;
+		return TCM_UNSUPPORTED_SCSI_OPCODE;
 	}
 
 	switch (sa) {