* [PATCH] scsi: ILLEGAL REQUEST + ASC==27 => target failure
@ 2017-09-27 12:44 Martin Wilck
2017-09-27 16:11 ` Lee Duncan
2017-09-28 1:56 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Martin Wilck @ 2017-09-27 12:44 UTC (permalink / raw)
To: Martin K. Petersen, James Bottomley, Christoph Hellwig,
Hannes Reinecke
Cc: linux-scsi, Martin Wilck
ASC 0x27 is "WRITE PROTECTED". This error code is returned e.g.
by Fujitsu ETERNUS systems under certain conditions for
WRITE SAME 16 commands with UNMAP bit set. It should not be
treated as a path error. In general, it makes sense to assume
that being write protected is a target rather than a path
property.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
drivers/scsi/scsi_error.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 38942050b265..dab876c65473 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -580,7 +580,8 @@ int scsi_check_sense(struct scsi_cmnd *scmd)
if (sshdr.asc == 0x20 || /* Invalid command operation code */
sshdr.asc == 0x21 || /* Logical block address out of range */
sshdr.asc == 0x24 || /* Invalid field in cdb */
- sshdr.asc == 0x26) { /* Parameter value invalid */
+ sshdr.asc == 0x26 || /* Parameter value invalid */
+ sshdr.asc == 0x27) { /* Write protected */
set_host_byte(scmd, DID_TARGET_FAILURE);
}
return SUCCESS;
--
2.14.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] scsi: ILLEGAL REQUEST + ASC==27 => target failure
2017-09-27 12:44 [PATCH] scsi: ILLEGAL REQUEST + ASC==27 => target failure Martin Wilck
@ 2017-09-27 16:11 ` Lee Duncan
2017-09-28 1:56 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Lee Duncan @ 2017-09-27 16:11 UTC (permalink / raw)
To: Martin Wilck, Martin K. Petersen, James Bottomley,
Christoph Hellwig, Hannes Reinecke
Cc: linux-scsi, Martin Wilck
On 09/27/2017 05:44 AM, Martin Wilck wrote:
> ASC 0x27 is "WRITE PROTECTED". This error code is returned e.g.
> by Fujitsu ETERNUS systems under certain conditions for
> WRITE SAME 16 commands with UNMAP bit set. It should not be
> treated as a path error. In general, it makes sense to assume
> that being write protected is a target rather than a path
> property.
>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
> drivers/scsi/scsi_error.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 38942050b265..dab876c65473 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -580,7 +580,8 @@ int scsi_check_sense(struct scsi_cmnd *scmd)
> if (sshdr.asc == 0x20 || /* Invalid command operation code */
> sshdr.asc == 0x21 || /* Logical block address out of range */
> sshdr.asc == 0x24 || /* Invalid field in cdb */
> - sshdr.asc == 0x26) { /* Parameter value invalid */
> + sshdr.asc == 0x26 || /* Parameter value invalid */
> + sshdr.asc == 0x27) { /* Write protected */
> set_host_byte(scmd, DID_TARGET_FAILURE);
> }
> return SUCCESS;
>
Looks good to me.
Acked-by: Lee Duncan <lduncan@suse.com>
--
Lee-Man
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] scsi: ILLEGAL REQUEST + ASC==27 => target failure
2017-09-27 12:44 [PATCH] scsi: ILLEGAL REQUEST + ASC==27 => target failure Martin Wilck
2017-09-27 16:11 ` Lee Duncan
@ 2017-09-28 1:56 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2017-09-28 1:56 UTC (permalink / raw)
To: Martin Wilck
Cc: Martin K. Petersen, James Bottomley, Christoph Hellwig,
Hannes Reinecke, linux-scsi, Martin Wilck
Martin,
> ASC 0x27 is "WRITE PROTECTED". This error code is returned e.g. by
> Fujitsu ETERNUS systems under certain conditions for WRITE SAME 16
> commands with UNMAP bit set. It should not be treated as a path
> error. In general, it makes sense to assume that being write protected
> is a target rather than a path property.
Applied to 4.14/scsi-fixes. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-28 1:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-27 12:44 [PATCH] scsi: ILLEGAL REQUEST + ASC==27 => target failure Martin Wilck
2017-09-27 16:11 ` Lee Duncan
2017-09-28 1:56 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox