From patchwork Thu Sep 10 07:39:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 11766933 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 348B3618 for ; Thu, 10 Sep 2020 07:40:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07770207DE for ; Thu, 10 Sep 2020 07:40:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="diwK5Lc2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729942AbgIJHkC (ORCPT ); Thu, 10 Sep 2020 03:40:02 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:55883 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728297AbgIJHj5 (ORCPT ); Thu, 10 Sep 2020 03:39:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1599723616; x=1631259616; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=/Enw0bxROuh57kxKsP52N1Tlxw3lASJQr7vvPQRxKmk=; b=diwK5Lc2Xet+Py5Juq2tJasMJD2kxcskOGAgfgqbH7X+3/WyJ6JNBx7+ WGxiIyn7e99GXKJAAX2k9kE27sHsK/rJFiCxyTwOv5BF14WaDz1ytRq2O DVTaUjLHFdVp86hBgfXVbAJEZo00DZnfMWu1hiJ5CUBMCODcSrxy35ZKn fgujFZNh9AcMPORmAuSiw74O5VJKMFBkQA/MHyG/s7baqGVNIvq70PS6l XYQuX29DaME9/eQkkdVxrelKyJHeWibNdicvq+F/LD8oaugd2b2Q43qNQ xH72yjRIByixloNb/MSdYXLtDK3nY2zDNoYLUNNJARHQf3JkFe00fjV9x Q==; IronPort-SDR: Kogpo1reQJRcNRFRYqni7WVOnfJPJVAw/elIWZiswgPUkFXgpcnbVc1IXZgVPtuEfiRvsY6TKw zSK16p4Aa/EdzSuW0aT0Mhw27/nIav02uI5+xRZfZlJ54h1jGF770zdUYeBys40jDibW9ozkZF i0gZY49leT4n54Iq9nV9F6zjeQIZa1OKg7vM8xUKXt4qExLDxdPTvfDS09LDGSDZHKSRminPjw tt6oLLlb2FynXeicK/OHdEQLDTQU3MAiQeWVGImC0/mbmibBcmb96aIR0u7T/CB438a2yRdGnx 6hs= X-IronPort-AV: E=Sophos;i="5.76,412,1592841600"; d="scan'208";a="250308642" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 10 Sep 2020 15:40:16 +0800 IronPort-SDR: wtuEb7iZwUijJkL9P1wEe5LAgPKF8gazmlBU3z9fszu2xFlNqv3dzrIN7FzkA+vQQuzGh2QhMi IBw7sSAdhUVA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 00:26:20 -0700 IronPort-SDR: KETUFnc3Orys9axTOdvst/YHyj9mT8xQuQPMJWaQwJqZ0yJXKTUJH03l4fBSSRe9yvIgtzYnhA rFloBbfxqo6w== WDCIronportException: Internal Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 10 Sep 2020 00:39:56 -0700 From: Damien Le Moal To: linux-scsi@vger.kernel.org, "Martin K . Petersen" Subject: [PATCH 1/3] scsi: Cleanup scsi_noretry_cmd() Date: Thu, 10 Sep 2020 16:39:50 +0900 Message-Id: <20200910073952.212130-2-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910073952.212130-1-damien.lemoal@wdc.com> References: <20200910073952.212130-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org No need for else after return. Signed-off-by: Damien Le Moal --- drivers/scsi/scsi_error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 927b1e641842..5f3726abed78 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1755,8 +1755,8 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd) if (scmd->request->cmd_flags & REQ_FAILFAST_DEV || blk_rq_is_passthrough(scmd->request)) return 1; - else - return 0; + + return 0; } /** From patchwork Thu Sep 10 07:39:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 11766935 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45152618 for ; Thu, 10 Sep 2020 07:40:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F1A8207EA for ; Thu, 10 Sep 2020 07:40:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="Xuxebrn6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729953AbgIJHkJ (ORCPT ); Thu, 10 Sep 2020 03:40:09 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:55890 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728463AbgIJHj6 (ORCPT ); Thu, 10 Sep 2020 03:39:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1599723617; x=1631259617; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=ihHyBxD2oH4qGwS+4TB/nNes/kLL2ACBhku5O7IQK9Y=; b=Xuxebrn6h2XmvsSSiRkjpIh/rSQKbo0YWAdPz1P0aN8fqjygdyu4gfXP 9QCBS8l4Ebi2szBYjBqWzkXwmrf1dmpTv65tEQdwmELxzJsuiL1DCepDt 2zLjvsdsljgyUYz1zZH7IarWnAdtIM6iMkxWKD1aUVtEl9Fm+x7URJhLW y/sJiMD7ee1mkkSyv/4L/CMS49bouYIGI7lGVv7ZAhfcGALidfiPoMdyL ftA8jw67HiEGdGnVPXo0Z8cp+4s1Hm36Id22Y1umb8i2RauX9GKmwFLK3 EXo9n4oqHbTld1R9AsKJ3RqxoXaiwSsj+FDZlkMHd8ZSmR1rEsaNJxo7U w==; IronPort-SDR: gQ/r+gF8LQ8Auyq5lpaYG+k2tMLd128AiO+PfjoWRG3CkY8QTv1VjeBf8pchPf9IRKGdfj8YnC AwTwnEhRlKyBPPIotXbBMI9H7kB38cyyw9Gs1Fo35fnGehJbL2KgL3T7YwDn+QlkOz2rWBGYOw yVe4ga5SIQuuPXp0DF6u79i5Sokjdgzr3P+rNTycLKU/PXowGhEh1M8G9CKjkp1jMQtmtEH2Pd tK19MWQ8TT0J0mC7kxYTzfCvufBTl6UaOc9KV3QJxAlZzKC4mTca91J+0lnN7rjwQSXAzbTcH5 TzM= X-IronPort-AV: E=Sophos;i="5.76,412,1592841600"; d="scan'208";a="250308644" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 10 Sep 2020 15:40:17 +0800 IronPort-SDR: wSiXmwZP7FaExaKctNUL4tZTEzEXGELP8yApOQQtHfgOVJhj65alGPZxuaSZCtzqglRveZQsly YtyrxQVNWhJg== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 00:26:21 -0700 IronPort-SDR: 68OCKHlGVLiBNzAz/7oVEPkcG30+X7WesAN/u2+NI7dh+C4Jjk3I+cLHXWD2d6jbi3bmuLdUZy eA8KHCH+vDYA== WDCIronportException: Internal Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 10 Sep 2020 00:39:57 -0700 From: Damien Le Moal To: linux-scsi@vger.kernel.org, "Martin K . Petersen" Subject: [PATCH 2/3] scsi: update additional sense codes list Date: Thu, 10 Sep 2020 16:39:51 +0900 Message-Id: <20200910073952.212130-3-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910073952.212130-1-damien.lemoal@wdc.com> References: <20200910073952.212130-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Add missing Additional Sense Codes listed in http://www.t10.org/lists/asc-num.txt. Signed-off-by: Damien Le Moal --- drivers/scsi/sense_codes.h | 54 +++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sense_codes.h b/drivers/scsi/sense_codes.h index 201a536688de..805d4c13d070 100644 --- a/drivers/scsi/sense_codes.h +++ b/drivers/scsi/sense_codes.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * The canonical list of T10 Additional Sense Codes is available at: - * http://www.t10.org/lists/asc-num.txt [most recent: 20141221] + * http://www.t10.org/lists/asc-num.txt [most recent: 20200817] */ SENSE_CODE(0x0000, "No additional sense information") @@ -29,6 +29,7 @@ SENSE_CODE(0x001E, "Conflicting SA creation request") SENSE_CODE(0x001F, "Logical unit transitioning to another power condition") SENSE_CODE(0x0020, "Extended copy information available") SENSE_CODE(0x0021, "Atomic command aborted due to ACA") +SENSE_CODE(0x0022, "Deferred microcode is pending") SENSE_CODE(0x0100, "No index/sector signal") @@ -72,6 +73,9 @@ SENSE_CODE(0x041F, "Logical unit not ready, microcode download required") SENSE_CODE(0x0420, "Logical unit not ready, logical unit reset required") SENSE_CODE(0x0421, "Logical unit not ready, hard reset required") SENSE_CODE(0x0422, "Logical unit not ready, power cycle required") +SENSE_CODE(0x0423, "Logical unit not ready, affiliation required") +SENSE_CODE(0x0424, "Depopulation in progress") +SENSE_CODE(0x0425, "Depopulation restoration in progress") SENSE_CODE(0x0500, "Logical unit does not respond to selection") @@ -104,6 +108,17 @@ SENSE_CODE(0x0B06, "Warning - non-volatile cache now volatile") SENSE_CODE(0x0B07, "Warning - degraded power to non-volatile cache") SENSE_CODE(0x0B08, "Warning - power loss expected") SENSE_CODE(0x0B09, "Warning - device statistics notification active") +SENSE_CODE(0x0B0A, "Warning - high critical temperature limit exceeded") +SENSE_CODE(0x0B0B, "Warning - low critical temperature limit exceeded") +SENSE_CODE(0x0B0C, "Warning - high operating temperature limit exceeded") +SENSE_CODE(0x0B0D, "Warning - low operating temperature limit exceeded") +SENSE_CODE(0x0B0E, "Warning - high critical humidity limit exceeded") +SENSE_CODE(0x0B0F, "Warning - low critical humidity limit exceeded") +SENSE_CODE(0x0B10, "Warning - high operating humidity limit exceeded") +SENSE_CODE(0x0B11, "Warning - low operating humidity limit exceeded") +SENSE_CODE(0x0B12, "Warning - microcode security at risk") +SENSE_CODE(0x0B13, "Warning - microcode digital signature validation failure") +SENSE_CODE(0x0B14, "Warning - physical element status change") SENSE_CODE(0x0C00, "Write error") SENSE_CODE(0x0C01, "Write error - recovered with auto reallocation") @@ -122,6 +137,8 @@ SENSE_CODE(0x0C0D, "Write error - not enough unsolicited data") SENSE_CODE(0x0C0E, "Multiple write errors") SENSE_CODE(0x0C0F, "Defects in error window") SENSE_CODE(0x0C10, "Incomplete multiple atomic write operations") +SENSE_CODE(0x0C11, "Write error - recovery scan needed") +SENSE_CODE(0x0C12, "Write error - insufficient zone resources") SENSE_CODE(0x0D00, "Error detected by third party temporary initiator") SENSE_CODE(0x0D01, "Third party device failure") @@ -242,6 +259,9 @@ SENSE_CODE(0x2009, "Access denied - invalid LU identifier") SENSE_CODE(0x200A, "Access denied - invalid proxy token") SENSE_CODE(0x200B, "Access denied - ACL LUN conflict") SENSE_CODE(0x200C, "Illegal command when not in append-only mode") +SENSE_CODE(0x200D, "Not an administrative logical unit") +SENSE_CODE(0x200E, "Not a subsidiary logical unit") +SENSE_CODE(0x200F, "Not a conglomerate logical unit") SENSE_CODE(0x2100, "Logical block address out of range") SENSE_CODE(0x2101, "Invalid element address") @@ -251,6 +271,8 @@ SENSE_CODE(0x2104, "Unaligned write command") SENSE_CODE(0x2105, "Write boundary violation") SENSE_CODE(0x2106, "Attempt to read invalid data") SENSE_CODE(0x2107, "Read boundary violation") +SENSE_CODE(0x2108, "Misaligned write command") +SENSE_CODE(0x2109, "Attempt to access gap zone") SENSE_CODE(0x2200, "Illegal function (use 20 00, 24 00, or 26 00)") @@ -275,6 +297,7 @@ SENSE_CODE(0x2405, "Security working key frozen") SENSE_CODE(0x2406, "Nonce not unique") SENSE_CODE(0x2407, "Nonce timestamp out of range") SENSE_CODE(0x2408, "Invalid XCDB") +SENSE_CODE(0x2409, "Invalid fast format") SENSE_CODE(0x2500, "Logical unit not supported") @@ -297,6 +320,10 @@ SENSE_CODE(0x260F, "Invalid data-out buffer integrity check value") SENSE_CODE(0x2610, "Data decryption key fail limit reached") SENSE_CODE(0x2611, "Incomplete key-associated data set") SENSE_CODE(0x2612, "Vendor specific key reference not found") +SENSE_CODE(0x2613, "Application tag mode page is invalid") +SENSE_CODE(0x2614, "Tape stream mirroring prevented") +SENSE_CODE(0x2615, "Copy source or copy destination not authorized") +SENSE_CODE(0x2616, "Fast copy not possible") SENSE_CODE(0x2700, "Write protected") SENSE_CODE(0x2701, "Hardware write protected") @@ -342,6 +369,7 @@ SENSE_CODE(0x2A12, "Data encryption parameters changed by vendor specific event" SENSE_CODE(0x2A13, "Data encryption key instance counter has changed") SENSE_CODE(0x2A14, "SA creation capabilities data has changed") SENSE_CODE(0x2A15, "Medium removal prevention preempted") +SENSE_CODE(0x2A16, "Zone reset write pointer recommended") SENSE_CODE(0x2B00, "Copy cannot execute since host cannot disconnect") @@ -360,6 +388,11 @@ SENSE_CODE(0x2C0B, "Not reserved") SENSE_CODE(0x2C0C, "Orwrite generation does not match") SENSE_CODE(0x2C0D, "Reset write pointer not allowed") SENSE_CODE(0x2C0E, "Zone is offline") +SENSE_CODE(0x2C0F, "Stream not open") +SENSE_CODE(0x2C10, "Unwritten data in zone") +SENSE_CODE(0x2C11, "Descriptor format sense data required") +SENSE_CODE(0x2C12, "Zone is inactive") +SENSE_CODE(0x2C13, "Well known logical unit access required") SENSE_CODE(0x2D00, "Overwrite error on update in place") @@ -395,6 +428,8 @@ SENSE_CODE(0x3100, "Medium format corrupted") SENSE_CODE(0x3101, "Format command failed") SENSE_CODE(0x3102, "Zoned formatting failed due to spare linking") SENSE_CODE(0x3103, "Sanitize command failed") +SENSE_CODE(0x3104, "Depopulation failed") +SENSE_CODE(0x3105, "Depopulation restoration failed") SENSE_CODE(0x3200, "No defect spare location available") SENSE_CODE(0x3201, "Defect list update failure") @@ -419,6 +454,7 @@ SENSE_CODE(0x3802, "Esn - power management class event") SENSE_CODE(0x3804, "Esn - media class event") SENSE_CODE(0x3806, "Esn - device busy class event") SENSE_CODE(0x3807, "Thin Provisioning soft threshold reached") +SENSE_CODE(0x3808, "Depopulation interrupted") SENSE_CODE(0x3900, "Saving parameters not supported") @@ -456,6 +492,7 @@ SENSE_CODE(0x3B19, "Element enabled") SENSE_CODE(0x3B1A, "Data transfer device removed") SENSE_CODE(0x3B1B, "Data transfer device inserted") SENSE_CODE(0x3B1C, "Too many logical objects on partition to support operation") +SENSE_CODE(0x3B20, "Element static information changed") SENSE_CODE(0x3D00, "Invalid bits in identify message") @@ -488,6 +525,11 @@ SENSE_CODE(0x3F13, "iSCSI IP address removed") SENSE_CODE(0x3F14, "iSCSI IP address changed") SENSE_CODE(0x3F15, "Inspect referrals sense descriptors") SENSE_CODE(0x3F16, "Microcode has been changed without reset") +SENSE_CODE(0x3F17, "Zone transition to full") +SENSE_CODE(0x3F18, "Bind completed") +SENSE_CODE(0x3F19, "Bind redirected") +SENSE_CODE(0x3F1A, "Subsidiary binding changed") + /* * SENSE_CODE(0x40NN, "Ram failure") * SENSE_CODE(0x40NN, "Diagnostic failure on component nn") @@ -589,6 +631,9 @@ SENSE_CODE(0x550B, "Insufficient power for operation") SENSE_CODE(0x550C, "Insufficient resources to create rod") SENSE_CODE(0x550D, "Insufficient resources to create rod token") SENSE_CODE(0x550E, "Insufficient zone resources") +SENSE_CODE(0x550F, "Insufficient zone resources to complete write") +SENSE_CODE(0x5510, "Maximum number of streams open") +SENSE_CODE(0x5511, "Insufficient resources to bind") SENSE_CODE(0x5700, "Unable to recover table-of-contents") @@ -692,6 +737,7 @@ SENSE_CODE(0x5D69, "Firmware impending failure throughput performance") SENSE_CODE(0x5D6A, "Firmware impending failure seek time performance") SENSE_CODE(0x5D6B, "Firmware impending failure spin-up retry count") SENSE_CODE(0x5D6C, "Firmware impending failure drive calibration retry count") +SENSE_CODE(0x5D73, "Media impending failure endurance limit met") SENSE_CODE(0x5DFF, "Failure prediction threshold exceeded (false)") SENSE_CODE(0x5E00, "Low power condition on") @@ -744,6 +790,8 @@ SENSE_CODE(0x6708, "Assign failure occurred") SENSE_CODE(0x6709, "Multiply assigned logical unit") SENSE_CODE(0x670A, "Set target port groups command failed") SENSE_CODE(0x670B, "ATA device feature not enabled") +SENSE_CODE(0x670C, "Command rejected") +SENSE_CODE(0x670D, "Explicit bind not allowed") SENSE_CODE(0x6800, "Logical unit not configured") SENSE_CODE(0x6801, "Subsidiary logical unit not configured") @@ -772,6 +820,10 @@ SENSE_CODE(0x6F04, "Media region code is mismatched to logical unit region") SENSE_CODE(0x6F05, "Drive region must be permanent/region reset count error") SENSE_CODE(0x6F06, "Insufficient block count for binding nonce recording") SENSE_CODE(0x6F07, "Conflict in binding nonce recording") +SENSE_CODE(0x6F08, "Insufficient permission") +SENSE_CODE(0x6F09, "Invalid drive-host pairing server") +SENSE_CODE(0x6F0A, "Drive-host pairing suspended") + /* * SENSE_CODE(0x70NN, "Decompression exception short algorithm id of nn") */ From patchwork Thu Sep 10 07:39:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 11766937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F02DD618 for ; Thu, 10 Sep 2020 07:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CAC08207EA for ; Thu, 10 Sep 2020 07:40:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="GdMF+t3R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729986AbgIJHkN (ORCPT ); Thu, 10 Sep 2020 03:40:13 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:55879 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729161AbgIJHj7 (ORCPT ); Thu, 10 Sep 2020 03:39:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1599723620; x=1631259620; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=bNxucSJQ2vsEA0ivn//Ho+7RyK9uaBltANYvYr0OAnM=; b=GdMF+t3RWUXqgoxO2uAj4LqUt/cRE0A4cKiD8qnvBuIMCJ8U9Thko6w7 I0O/78IH1Ex+nPZM9MNjtIygVQZM6WEPl+i488i/MWOffO71MBAFRUYCo YJU9yk2d4oiy1A0fNVk1R4kJzwYG99hvNlH3ayubWZp2iTMvd6pL9yZog h4hZ7jkZnG/IAIgx/n0fj5YVM7OxjlaHy5RyOkmj3F80qnpS7j25j135q 7bGUgN/QwKWPpaFMWPLz/4/qD6bfeGgc+drlt+WE9N2AuDJ6slff+1476 koLGUrpWkjcmjh+ZD+3+c8cIMQs5URYx0ulswCeceAtlvZJMFZjYxQ+pR A==; IronPort-SDR: rsKLbiL3Xt/EhJximl3DiRtC7V3ghNmxVEhwWOZJ0hmd3pz6HWLoFkj/B/snwShFFJOjQjHF2c 8W02w3aSrvBhHUoB2uUiYz1O23/HsAxsuNU77u5Kbrruz/HibT9DB5n0B95QQZ9SXfWMwQAgK+ CwInq8buHQPQW1k+18bhnWfyksfqmeHLQF8xC506c1DqeZQUlXZLkxOZQTDtcfdDe6l2u6xL1F vVf38imdUUAOhQKB5p03I/C3gqc/rHC/VBav+Uj3lqGk1oi6py5DjIwQ3QILSRPeqryOfAVH7O LX8= X-IronPort-AV: E=Sophos;i="5.76,412,1592841600"; d="scan'208";a="250308648" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 10 Sep 2020 15:40:18 +0800 IronPort-SDR: MzOuoeJiXbR3gCwvDUb62sTfVbBIzMP3bmV0trqU3HB/D9J6saZcdv1FU56FCNU0Es+ac0VcU2 4zqyOGAbNxxQ== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 00:26:22 -0700 IronPort-SDR: yhhxweRy5zvO9e4ll1zBp+mWjoAl+ZvuLU4tNLOEcxWHXTAK6bFRi8U83STvw+cD+XVBj86AJP BkGn0/M/lxyQ== WDCIronportException: Internal Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 10 Sep 2020 00:39:58 -0700 From: Damien Le Moal To: linux-scsi@vger.kernel.org, "Martin K . Petersen" Subject: [PATCH 3/3] scsi: handle zone resources errors Date: Thu, 10 Sep 2020 16:39:52 +0900 Message-Id: <20200910073952.212130-4-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910073952.212130-1-damien.lemoal@wdc.com> References: <20200910073952.212130-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org ZBC or ZAC disks that have a limit on the number of open zones may fail a zone open command or a write to a zone that is not already implicitly or explicitly open if the total number of open zones is already at the maximum allowed. For these operations, instead of returning the generic BLK_STS_IOERR, return BLK_STS_DEV_RESOURCE which is returned as -EBUSY to the I/O issuer, allowing the device user to act appropriately on these relatively benign zone resource errors. With this change the NVMe (ZNS) and sd drivers both return the same error code for zone resource errors, facilitating the implementation of IO error handling by the user with a common code base for both device types. Signed-off-by: Damien Le Moal --- drivers/scsi/scsi_lib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 7c6dd6f75190..7eb4a80c3bbb 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -758,6 +758,18 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result) /* See SSC3rXX or current. */ action = ACTION_FAIL; break; + case DATA_PROTECT: + sdev_printk(KERN_INFO, cmd->device, + "asc/ascq = 0x%02x 0x%02x\n", + sshdr.asc, sshdr.ascq); + action = ACTION_FAIL; + if ((sshdr.asc == 0x0C && sshdr.ascq == 0x12) || + (sshdr.asc == 0x55 && + (sshdr.ascq == 0x0E || sshdr.ascq == 0x0F))) { + /* Insufficient zone resources */ + blk_stat = BLK_STS_DEV_RESOURCE; + } + break; default: action = ACTION_FAIL; break;