Re: [PATCH] If the list ID is not supported, return TCM_UNSUPPORTED_SCSI_OPCODE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux