diff mbox

[2/3] sd_zbc: Let the SCSI core handle ILLEGAL REQUEST / ASC 0x21

Message ID 20180417010441.28903-3-bart.vanassche@wdc.com (mailing list archive)
State Accepted
Headers show

Commit Message

Bart Van Assche April 17, 2018, 1:04 a.m. UTC
scsi_io_completion() translates the sense key ILLEGAL REQUEST / ASC
0x21 into ACTION_FAIL. That means that setting cmd->allowed to zero
in sd_zbc_complete() for this sense code / ASC combination is not
necessary. Hence remove the code that resets cmd->allowed from
sd_zbc_complete().

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/sd_zbc.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Damien Le Moal April 17, 2018, 10:39 p.m. UTC | #1
On 2018/04/16 18:04, Bart Van Assche wrote:
> scsi_io_completion() translates the sense key ILLEGAL REQUEST / ASC

> 0x21 into ACTION_FAIL. That means that setting cmd->allowed to zero

> in sd_zbc_complete() for this sense code / ASC combination is not

> necessary. Hence remove the code that resets cmd->allowed from

> sd_zbc_complete().

> 

> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>

> Cc: Damien Le Moal <damien.lemoal@wdc.com>

> Cc: Christoph Hellwig <hch@lst.de>

> Cc: Hannes Reinecke <hare@suse.com>

> ---

>  drivers/scsi/sd_zbc.c | 10 ----------

>  1 file changed, 10 deletions(-)

> 

> diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c

> index 41df75eea57b..2d0c06f7db3e 100644

> --- a/drivers/scsi/sd_zbc.c

> +++ b/drivers/scsi/sd_zbc.c

> @@ -299,16 +299,6 @@ void sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes,

>  	case REQ_OP_WRITE:

>  	case REQ_OP_WRITE_ZEROES:

>  	case REQ_OP_WRITE_SAME:

> -

> -		if (result &&

> -		    sshdr->sense_key == ILLEGAL_REQUEST &&

> -		    sshdr->asc == 0x21)

> -			/*

> -			 * INVALID ADDRESS FOR WRITE error: It is unlikely that

> -			 * retrying write requests failed with any kind of

> -			 * alignement error will result in success. So don't.

> -			 */

> -			cmd->allowed = 0;

>  		break;

>  

>  	case REQ_OP_ZONE_REPORT:

> 


Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>


-- 
Damien Le Moal
Western Digital Research
diff mbox

Patch

diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index 41df75eea57b..2d0c06f7db3e 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -299,16 +299,6 @@  void sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes,
 	case REQ_OP_WRITE:
 	case REQ_OP_WRITE_ZEROES:
 	case REQ_OP_WRITE_SAME:
-
-		if (result &&
-		    sshdr->sense_key == ILLEGAL_REQUEST &&
-		    sshdr->asc == 0x21)
-			/*
-			 * INVALID ADDRESS FOR WRITE error: It is unlikely that
-			 * retrying write requests failed with any kind of
-			 * alignement error will result in success. So don't.
-			 */
-			cmd->allowed = 0;
 		break;
 
 	case REQ_OP_ZONE_REPORT: