From patchwork Fri Aug 12 01:00:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4944C25B06 for ; Fri, 12 Aug 2022 01:00:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235108AbiHLBAr (ORCPT ); Thu, 11 Aug 2022 21:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236128AbiHLBAo (ORCPT ); Thu, 11 Aug 2022 21:00:44 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5590D6DF96 for ; Thu, 11 Aug 2022 18:00:43 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN5WPH004252; Fri, 12 Aug 2022 01:00:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=cjWFWY9MFeTAjy9Kg9l9TRC6zeTI5JhBszcFFojiKIw=; b=EqIX9iplUslvKC5VsfsJt6OoLFvcOMMoO9dqomQ7MCUUoePpb8mPDhWRP+2LCjCaH29N INbyVjVhkpaZTJmfk1sPVoihXsOpaWQwO/TUbOcmqqGiobGgrWrGd24n3ZgpDCIb5w+8 gJpzvDphrd13Q72V+GGWmU57XEM97Og0HPPqF4uMY1K1REYtfO2a8KiuIEaQBBgT2U/p 5tmKH7ddsdW/r7uQMj14xgcWJF7z5psW2wNzet0nJeEaTgOQ1OU7pebTk1aTp+O5INV1 bEQ+/S80XBWf19bZ82v/Tm4vL0VZetepSBjPLJSsgd43GIZ9bmvxa1pioGEOV+fNYEhm 0w== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwq96bm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:33 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27BNeHNf040773; Fri, 12 Aug 2022 01:00:32 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqhd9qq-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZXSb4VlZvhXIVnz23awy8/GTBQg7y1LH12blGewtb+OaRi1XoSGXHgsbdxzxkF9LE/aEMRzWsvEfbFWy+LvLa0BS+ZJCEg5/y6DmzxNuoL0IsU6Vdp8h8Dg681rcnUTdmTiD5Vp8EAYbGoQyFuMvdp7lLdUojKy946IQ5cz+LnJraTWkJFks7GyfNRG6ESy3fcD+eJ22N52LjLRmEMISke0XQXuOvv1f+gG8+M7oh9xSKSrN4wPlFuNBARiuEFK0zmsY27Qrp6hOdd5arQT7hoxuJqSBiKnzqTqd0dxMe/+YqgP3uImHEvNjMM0STC1gN1ME/gL+gPAFWYgjn+2LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cjWFWY9MFeTAjy9Kg9l9TRC6zeTI5JhBszcFFojiKIw=; b=aHa/71c3FqfSUdfDxmeARZCIP+U6XallPGhNzvQuFEgdL/+L46fBq9MxBGZa9nxmW+hYmPK/ZQkul2zgV/4rp9CX7ib0aRNv+Ev7HuG/bVQUaKVf0Y2c+RQBnHN0Jp6oqmLIdMo17Yu0anUX+KV3AJmcjxxm5wEwJNcV/Ine7xVixucAx9AO02p4NlDqRqSWOYwSdnbUPPklW+ZiUBDkwv4ku9xyQfcujLm6QVIU3hZcUKdpIB9UqxRJf1mjEBbHSLf/y/PYyZkrE1FJOkBQlPHEvVPtn18JLPa3KiPhRt3Zyk945cTxCuPdLdPvH4B7BJvtHR7621wRgDlWpClvEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cjWFWY9MFeTAjy9Kg9l9TRC6zeTI5JhBszcFFojiKIw=; b=PlB7Ri6UJdQMMtoNrlUB2e2yA0XWIm4gAF3Yf1WJ5SbwhaAVDpJDNihZIp31vBRCQn2f+8FtZzxfukobk341ZcfdkVdbDc4tY7dHANWX2yQslIPZ/qAImiKBFQTDMFF7G8XkWRYo9vSXCp2e4Ti4jybcLoXvNuYiHaAdScBBTAU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:31 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:30 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 01/10] scsi: xen: Drop use of internal host codes Date: Thu, 11 Aug 2022 20:00:18 -0500 Message-Id: <20220812010027.8251-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0078.namprd03.prod.outlook.com (2603:10b6:610:cc::23) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7762310-dcb5-43c0-005d-08da7bfe0da4 X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: auE+tHH27eUelvX/PcG3FzEspt/S9IIQjrtjGzaOSpq6k2mKTBOTZM9jKpbjgfdR8VSN6UR1cLgAo5RtmcyXav811rKyv8TlntkD+IDGR2ThPxPlZNdYJsytgilgTXOPLmuLLkP56aYR24iDJ2A9Jgr9LHBEWeGi5WST/4gXux1QNWySVaw6yR4rcWhcoySKTQsz8UdN4u68ftrqJbekH7Wli3+Bx7GldeEvD4gNIigJg1DpDDuUn3fL6th2wusu5IkbMyIeZ+MqrNBzW7lxfdFAij5ySm7Nh8EOqYDstihiT/Ss/Pl/d4qbKMcYRFhsmbhbeaLcsggSZhVL1rtr8w+APVqcL9S4tzA/8lzt0r7DFcb0g+bFCj5DdaIZx4jExGEdfb+GQEPIAS4XWXUIWBPwWQy2m66ny/8ghVOQv6a3q0Q2ci7toApWLMTka4Ybxdd2aGz7pMh1DNrndtz0fesBNHiLzfzZVPbrq+L1adyOYrz8QUEu06X6z3e2+wW13QepD7cL5EvqiQgNDgbm6MAndv6z5gzwGfHx7LSZsQbUzWEG4FLGisry/xdsHjRb5W2bPdmmwuqSWWEDu5lbVNaZlt6ph7JXbJepaQOvRNXsl3fH1qhgHK8IAIfRIrj+H4hZwQudtwikMOTw8olxroZMKrgHpy8r7AoPYAifk6+LvrkluZCKV+xj97b0/88/35Dz+AQUX3nRJW/oEtUtJb3MaCLSpNEqkKTFCRXpFWlQjUnRBK/osd/P4TMk/7Wr3VZfbEfa5O4Tx2sw6f4HZDApMJ4byoW1i9Wari8JBRQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(107886003)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aABv5KEaCXdY41itV0P9YWBPpiH8D8vTGIIsXULK8S/Uj3dxUmlbz44GblvSlIuw0Rs0NX3ZFdqfad0dGYMH1c1LLCRKSkrrG5y1ORxgf9Pt1BRV/NPzDt8pwB7Xm+CKAzwfwGxzrHo8he3tiEtuKUAZW0fT4HUMq/suVnYdYYNmSby1GOWm8+fb4wyrqO3UDYZOmPtxPMUCHJV3TcdQf/zemAw7fiUVWmbvVQQsn+RKROuAUSjmP2zX8HZ/pIiBl15zYRkCWAb5/RX4ib7iNSZ4mK3AJAb4QkT8C1ZMqzECVAU5fEEsZ1ZeiehHFiKqJXmpSohAqcsOLUZuFzW5/dkrQ7DWInXsntrh3TYattTuR/VVRdBM+v6lTsLyRoqM2J+qXTzUoC6Iteey+17VgnvKF9mBSmvIGlGT/1Q6smvVNxpl6vAZtZ/H/ZmU/acnJrASCMpteqXIiY1etUeW7PZt6eDdZDVHRPAHbGPyI97bQexR20VL1s1DW7iCOJA7uOrG9OCCQxfozIr0bpqturgjpS60jjRxPmV8uOPM9afVd9JDXs/s9UpW92lbASDswBWxstMxaCOBuVyMfM9wazcOxKnSYYI1/kwAWcXmvasPsoMB3AJVdgUMzRFqjbxMr4wrxXul4sbVAs5YUCB+2kThnoQu9Yxv/OQL+PAQlBwevTXgTAAMIiNE1N5DneCHMCjVMw1WaqlZz1BhSnXlq4V9BeW5lTQMG0eRpDHr3LpPfHak3+e4asSPCGqC8+I9FzwvcN9MY9tRvMt5cg9ya/nE2sqo8qJCJd0OQnb2NYaOSNz0TWDmkyqKTHrMk4S8msNFPJvFu/1Nb5+4EoidSamsfm+OqjYrAxqEsDRg1D5jlSvJWh/25W4BOTc27ndcQnEpUtMJ1HlrzLq4T8IVy/OXfOS0QzoZo3KTCCjQAPmzq62dmsT3dYoPejwbVFXfthTJIdb/7yy1pPvYiRY2esU/Cmf/uepqj/fs+H1FkwNVKWCWQYgVZmMU6DNmCXee3Fnwu7qCqs4XGQuBXl/lhpW+9i5s4EnmSd4GFa0ehl+doN4txplwQ57HQLy7GlRi+NOvq9LjdpD/HrHg+J2CDRzjbvVtvc02Aobh9ZHa81J5ysxxzM4xaU9VgF38M3yfhcBrxKU/JJXVOzHt4csjo0HLuu5D6Nma1P+HlokDzknUODn5HKMwoidbK0xyl5waHjBwIeSyVMWH7zdNAHA3Q7VpuGG0ZYKMRqo8WCxGNjadP6DiYjZF18cdEif6TP5lHuZxYrprjXTyGigo0LwuzA9sjfV4ZsiwJMnJBXCnspzRZJ/ldg2GUdb9KqKn1d1SteeglWQokeLqBIcVeHhFMQoo3Kk7hcrtYqG2AEhE6fZ2VkFsizsV5/FlmO/2wnPosSuYrlBp2LNoGktvjpR5NFMQLJTSU5pSfHDCnIloZwEmJgwR2hiEph52Y1tln/5fC+/e3kb7zbMTuxgYCcVc2qGEO17t85nZCNObgeWTN4pMhNgnkLTiLhpa8ADHDOYapEt2KQzx7dCbIXuUgUbMKA8QdrpsQnPCcnnQxMIIHCUCKIUkRUiHlDADBVwpRQLlLPJCttqVi7oYH/IsAROyxQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7762310-dcb5-43c0-005d-08da7bfe0da4 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:30.8826 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DpB+5wqDAO4I49XGgq7LfiqJGhxdUFOt+bdxNrhcKMR5EapTSeBTfFy8FMzMJpfygr0CoHv7OHuCOF+ZoaXHd1pgfMel+YkMjY0EAHTL5+E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-GUID: kJudWStAqplPMiMFHpYSrO9l-UcRu-LQ X-Proofpoint-ORIG-GUID: kJudWStAqplPMiMFHpYSrO9l-UcRu-LQ Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The error codes: DID_TARGET_FAILURE DID_NEXUS_FAILURE DID_ALLOC_FAILURE DID_MEDIUM_ERROR are internal to the SCSI layer. Drivers must not use them because: 1. They are not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. xen-scsiback will never see this error and should not try to send it. 2. There is no handling for them in scsi_decide_disposition so if xen-scsifront were to return the error to scsi-ml then it kicks off the error handler which is definitely not what we want. This patch remove the use from xen-scsifront/back. Signed-off-by: Mike Christie Reviewed-by: Juergen Gross --- drivers/scsi/xen-scsifront.c | 8 -------- drivers/xen/xen-scsiback.c | 12 ------------ 2 files changed, 20 deletions(-) diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c index 51afc66e839d..66b316d173b0 100644 --- a/drivers/scsi/xen-scsifront.c +++ b/drivers/scsi/xen-scsifront.c @@ -289,14 +289,6 @@ static unsigned int scsifront_host_byte(int32_t rslt) return DID_TRANSPORT_DISRUPTED; case XEN_VSCSIIF_RSLT_HOST_TRANSPORT_FAILFAST: return DID_TRANSPORT_FAILFAST; - case XEN_VSCSIIF_RSLT_HOST_TARGET_FAILURE: - return DID_TARGET_FAILURE; - case XEN_VSCSIIF_RSLT_HOST_NEXUS_FAILURE: - return DID_NEXUS_FAILURE; - case XEN_VSCSIIF_RSLT_HOST_ALLOC_FAILURE: - return DID_ALLOC_FAILURE; - case XEN_VSCSIIF_RSLT_HOST_MEDIUM_ERROR: - return DID_MEDIUM_ERROR; case XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGINAL: return DID_TRANSPORT_MARGINAL; default: diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 7a0c93acc2c5..e98c88a960d8 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -333,18 +333,6 @@ static int32_t scsiback_result(int32_t result) case DID_TRANSPORT_FAILFAST: host_status = XEN_VSCSIIF_RSLT_HOST_TRANSPORT_FAILFAST; break; - case DID_TARGET_FAILURE: - host_status = XEN_VSCSIIF_RSLT_HOST_TARGET_FAILURE; - break; - case DID_NEXUS_FAILURE: - host_status = XEN_VSCSIIF_RSLT_HOST_NEXUS_FAILURE; - break; - case DID_ALLOC_FAILURE: - host_status = XEN_VSCSIIF_RSLT_HOST_ALLOC_FAILURE; - break; - case DID_MEDIUM_ERROR: - host_status = XEN_VSCSIIF_RSLT_HOST_MEDIUM_ERROR; - break; case DID_TRANSPORT_MARGINAL: host_status = XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGINAL; break; From patchwork Fri Aug 12 01:00:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 597192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1653C25B0F for ; Fri, 12 Aug 2022 01:00:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236136AbiHLBAp (ORCPT ); Thu, 11 Aug 2022 21:00:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234273AbiHLBAm (ORCPT ); Thu, 11 Aug 2022 21:00:42 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D82106B14E for ; Thu, 11 Aug 2022 18:00:41 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN5ZSI004328; Fri, 12 Aug 2022 01:00:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=pBbr0FAhayQ8SzXJACSfQ/zq8OF/o+w0h7J0NNcJ02w=; b=S09zYX1pVtLrUp1TgIBMk8fCMS847nPCdSdsEtl3AYFPqy1A2izjgx/ZAkUqiiWqby0o mY4l18KF6CbiT/M6G1jImzAT3I46oxPHk0cdtlzV/Aslj4kkMm5xwu0zLVvzmbzgtVOk zeS3ntDHQKOiD/HIfxkq1ONqwOmTCbmlPNfHfQJ5Ks39tu4vYqKP15Gxkmw2rbWgYYEq iKj8/e4hu4UAEiua8+B0datpRbrAh/ns2NEu86G/hRn+6rWNwU9Ev9PeVYxL4eYfMuII HjY9nD0xWWm7YXZV0RA0lSbycdBqEpEWh/W44pBRHmuq8KdzZ7g3wuM5GvcwhnAfdL8a Jg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwq96bm7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:35 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C0BuYh023733; Fri, 12 Aug 2022 01:00:34 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqhnq3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Htg3iY+4mJgnC/ieKMiy8uFEK5oZHLYi6TJ6Wva91meml21c2gA39BoiNQXqHaQJrVoaU16C1nfwReTqNe9aIB1B1lGh4K9eAPmzjbK4zsEWKAaFWyaAAnGF6AauT+SoCVViSitZSMsgjltMdz5dpIpqBI8ElaFaZMI2UXau1DsCkpwrsWoVhwfeF7pc1qDmr4Of3+IbADB0oarm0NzGzoLH+9Bs0vUlkBTYiue0Lb6bchSQ0V/LN1BRteioHjklyK0pUKWz1P+xy2AiSnHXm27rGWE+VN+h/xZBSwEeUyBz8aVz2uXaKJLhjjlSFgDq3JowdKmIMXG3YHqRJR0rLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pBbr0FAhayQ8SzXJACSfQ/zq8OF/o+w0h7J0NNcJ02w=; b=BrhrK7T/YfAMRbZWa3hNey2/6cjLqiMWfqvlZT0LmHIsxZCKqBEfQFSp9PLSfI5tfdXjWVY1gGkQWi922ijFIoeezeCBLalZyYKk2VXRoKZq71rt/dcxWl+6udsEqRgF3nuGUza/wq8yHbePcFCECt/NQLB25Gr8nX/wjpF3TJcFcBqsT3aU7ZCeH30NUBBVtwA6tr/oF39Vv0TNipqP8UrJO3THs2ymIyzrqsQmC9LNRlJiIY6LhD2QPhVwtIkfm/E5qnHvXhAWyruIHRywXwA1bzPq6bBPAPGsBrlmTFK/Hw0v67bnj5LwOMl1RFASBrprUjOnvkwOvqv12atB+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pBbr0FAhayQ8SzXJACSfQ/zq8OF/o+w0h7J0NNcJ02w=; b=MI8zvIu4fImGvzugnSremL5IC7bqouTI1mmP5W+jBGZ0GutXPgOUn5Tw+yAb/jQ58eLykkKL8GXha6GOVY4aIPKw8BCR8Z55HuXTZEqZb/8mJP4W5Eu63zBc5i2avFD0CDuLJl8dC4H+DNvErP6fmUmAxXXukkY0av+Wj70+c40= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:32 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:32 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 02/10] scsi: storvsc: Drop DID_TARGET_FAILURE use Date: Thu, 11 Aug 2022 20:00:19 -0500 Message-Id: <20220812010027.8251-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0077.namprd03.prod.outlook.com (2603:10b6:610:cc::22) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95529f2a-3fb4-4c48-16bc-08da7bfe0ea3 X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qUZzR6auCMT/mcftOLdaFJKd0eRlJV52GJW1Wig90DIJ7BTcuFBvRaybci7LwWRrQ1lbGaF+cYAEZTFAVB1PtYnTRetJKKLDqtT+vQiDaANyn50h9ZtPYOwV/t9qPZni8AhOR+Upj7ACDs1XFACiWIpsCX6kK+y3Lk2ybVaHc4YlSh5CpjZRfqtun1nmBLjEi+2fqCDceBqmU5RclGZCL57wqIV6Q6FE3GzZsU7TcWal1WQy8b8TsLg+ZD967IET03NJkKBY3LxNSOHJCyu7HmAIoPBUG1sGPRQETfd8m4SIFf/P/ZdJM4omo+RgsFOqorS2G0jht5HnT52qPV0XPaXHvjJE+8vdJPxZlSfV6XWjgVAqdssSNWbz4V2m3e3vIgo7MhmVYmb7qFIk5XWCIadcmfG4y7JDoJNCC1sl1PseiX1VRFSCQ5BCTjtdjJCQE08YlVCOXMJs+AnrFPOO+UcICoI+9NESpIJmKjUi8gAwt/UuxjYMGRDm9C+8wIBl6PEVcB15vgqCsxuqd6nkY3CUAt/Yd0rNA9FPNSpnZxTwxsYmvNCYN/5LGd180q57/qznf3J68zYY0Tu5aPcPuv5ICMb4EP+MaB6hMj5CJkxRZX/Z89EcPEeYM9IbfzjZfkyn9qsqM4p9HTqb0eGlLxeXFwtGdykaEMI5QTL20cxVWXyC8PMcUzIxP41XwVhB5fbBe1p0rJ/XodX77w4xBzEW6pl/4vM+nMNqCi0wNAd441BWXcZW5sBP0Qben1PUvY/ht8jwkY+mvcDCLwqHuexPxWvHVNXEiWOcWY9fYMA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(107886003)(186003)(6486002)(2616005)(478600001)(41300700001)(4744005)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mQ50CbQ8qzf6/rt0cXfH9ir/fgM4VKzeOjANpYunIUXdjOsesTB3wva/iqCpbslsF06t3KCUxg+PV+0boG3HHUvMiJbe09lCT5v5Jq1PzIaRa5uE5Ha4C8p+kSMmn7j0ftnn+aLvZdg5IUPo1N7/mE3mu5PubZrmgLQAra1nHHC9zCVsQavaPMqGA6ktd8bNWNt9mdFaIHMLEPxfpN6JJmI3enUoKM/xI+OdF9g3Pz2y6JLYLxAicWKYfV5bIidgSYE4ePEhbNzM8IsZmBSu0aYvkWYpX1AYHh3pSKO7B9SxgxeqYqMh6adUoLEoxJWkCFFKmZ9XtQtaR32ZHhWy2KRksg//NfGijo1yDIaxYGi4PT8YqAYm9t6PV8fBxlWJZWuuiAG+/nm4jFaTvhRVsu9xdBk/Uzqc4K8FUVgHrFh5xuClwy9o5qGjTwzFrE9oPLmuzn8YNsnukumIxvmAd+W0641fwLz1EmB67Eb/XJ0ypZHO2rg9d+FInwuj234NHnkDvxRX5CBelTATDtdFHozPf7Fzg8bsXkKtXtAP51DsrJ0Y5ib7ZyqpfxANsvugj7V//7cMLoCE4UAgvYDNkSLgFfuyzhEl06B0Q7QaZkURsjFDVOtZ68HhmpBYJZna44ia7RTJGmhL8rHHQ29Ty6cyYz71rX3eZ+uQzYqmcYhhouGgrlmh7h8wPbnDwloBJixQgR2W3W+WfBTzWqt2A3d0RwbljANKjNNdUYf8IsSlhYt1hPCAlHD/8m66vlqg1bgwR7BAzi5m2z9L8J8kNiC4xSIJrnpH3suZCMMV5jc9nNnrbH+NKDaqxuK99Cfkr2alojGsLWJkcUGoEtw2h1yEdkqM0fexLomg7cGcawseXygPqxJ5tVJG8RcZY+Py8q0QKFB3cCT0QMhhPJHt36njCx5eHjpo6hwCL87szhT9j3aL8DyO1Krl0yCbuEnrZZxNeMe1zQlHMjPOQQratcLGZGSMZWKuI3srulXIZQoLWDZUB88NaY5wd53LjALoo8pizsjgR/vvvaJimRyB7pwjCsvVyjP4UtjTAyWT3RLUm3cbrUI7j1VJ/14UI8HwS2RSnkAzB6vZP6w4E9wm54IdjSCGwenfZiB+X2tfGJZIq/S/pnA3WNuvZjAdR0Y+9yN/atEHaHCQwjRKXZGk9As8kOe3mcTOMnOOEgYcw5V5XK+Zdwi1Ri5CT7Mj0icAkf3/xNLCuRZJgxAZ6FXkeTV2G6rPJNnzOxwhCP8b3ng6x73LaaKmgRJCyt0P3sGinD8KdsbCI4dRcQKB/JT8Vootd/hl+qNm9Y3yWeHeqZRBZI4cMbDSvmAfStVhDPVpCVS1Tw9fhYawoMu9zYFCOZJ23XqxlcwkzsZtHui0+70/AVJzH3Q88PHMzTZARG4h9jESZz2pFpuqycoQdDkWvzw44OB+MuK6EHokCJuW1dFB+CBb4VcoAKffoNVWq/AllMYAtg9tlCFxIfZveWo5GGHyVt5XGwsaSjcxqxUa2RNILH3BDXJeINwIkDh+eTbz/7HbM7vbGNXkmFBrU0+IqVFbbyEGvVN+gSEUHm8daFjLBdAhFTNBjppYq5k/l9nAIvFqv0tTp0r/sr9svlT1Cg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95529f2a-3fb4-4c48-16bc-08da7bfe0ea3 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:32.4919 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hoc8hQ0t9eykHOrgPweAUS8JC6MJ+aQaT3e1U0Pa6EogGrr5UECJ8nAHKEOxnxQ/N7CvvdooB6ch4YfSLIQa5CzPTjkxoRYUPcAE8m2sJTY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-GUID: VGqCxKFHrR5VqWjKjVoQ1ZczdLcwz8nG X-Proofpoint-ORIG-GUID: VGqCxKFHrR5VqWjKjVoQ1ZczdLcwz8nG Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for them in scsi_decide_disposition so it results in the scsi eh running. It looks like the driver wanted a hard failure so this swaps it with DID_BAD_TARGET. Signed-off-by: Mike Christie --- drivers/scsi/storvsc_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index fe000da11332..25c44c87c972 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1029,7 +1029,7 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb, */ wrk = kmalloc(sizeof(struct storvsc_scan_work), GFP_ATOMIC); if (!wrk) { - set_host_byte(scmnd, DID_TARGET_FAILURE); + set_host_byte(scmnd, DID_BAD_TARGET); return; } From patchwork Fri Aug 12 01:00:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 597191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E63AAC25B06 for ; Fri, 12 Aug 2022 01:00:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235625AbiHLBAu (ORCPT ); Thu, 11 Aug 2022 21:00:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231609AbiHLBAp (ORCPT ); Thu, 11 Aug 2022 21:00:45 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3E4F74CF1 for ; Thu, 11 Aug 2022 18:00:44 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN6ftX023117; Fri, 12 Aug 2022 01:00:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=0QLKe5jbBkVuExRrCxCmWUELSE6zTcBSJiAbPzLfFI4=; b=gsotiykc9q/f6cPUCIsvm/wQ2FAf57kqJRqxWWNMr30hM7u8AG8vVtg6yC1g1oVAYrfD r7WehTCw3pVkSbFgShW9xUBVSBs8U8naDwtkvu88a4tQ/WPprc4WvZzUfNgnIimfAiiK f/NsQ992648fe8FXc0b2X8Apgwa90PLIeGSnQhD7fTmdYDgLqQe5oExnGKhX8Rh1rpqX mXTs4mg0CTp23m3ZYQJw8Ds6raV6RbTI0GjRVTWDmElIS6VGgRm+M1DfszDrrDoAMvko ZbXUzPaAhbLFpfwwL6kK0n8tsVADIvUQoNrzJKC195bPaKVo/cU9e2HAO8I5p8wMmupi Ag== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwqj65k7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:35 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C0BuYi023733; Fri, 12 Aug 2022 01:00:35 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqhnq3u-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UmCf7IsDDwYVy2mOr9oPBrBKHGro4Lv/2PHdS5ftaLDOU7FLwGm43t0VgyonyalelZU7lcbUil/b9iBHUPXst5Wdmt5mZo9izIHve3YTtaeXoO5BOEohaesv2e+mEgLe+rYGEJchcFcnS23kGtMuPFhCTvEyyI6EKTWsRMFdU22zQkA9CGDOSoLfZaWaLV7Alya1aaJE0ZTplwX410lVUcpIRuxGj6pqm33vK6O7pOxd4Ru7xt7N5Q7Wl+uLnx05JLWXZnJ3N9VEQC03Tad9zEbN91g2xr82gVeEnLbAMZ+k5qSnTFVV7C9dwethngtYVD9UDOZC52LiX8j+IBsseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0QLKe5jbBkVuExRrCxCmWUELSE6zTcBSJiAbPzLfFI4=; b=OLVuesRKyz/z/MxlJkQezfYDgXI/bo8PUSbSKnW+XbYmervj3NhYD37etsLq/AlvX+6kC8hmWCKJHVYB09h+hj9h4U4igMSn4BD5Gp6nSgX2Kf9Nip8fa/KlJlXLfI4y8E5i7ZohirAReRWk2r2t/flOTE6LGJQ4r8Ch8zdO+wJghs80h/wEob0yEPJkuFwJX4UYK0J2wxD+tKTX/Nn1cUtz0WlgzU/2wC1ZjBM5ACGIwHsqPFDxDRLWiAZ0mfXcWHXtN3KvgIloo2BipgjLYVbr73vROeasCv64CYkpefFESHpQ5quXpYT30fDARNBtgGgh3oiGux8r55v091p+Bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0QLKe5jbBkVuExRrCxCmWUELSE6zTcBSJiAbPzLfFI4=; b=bzu4+7FN4Bc4mat4JMTK9boI7qni+BHRhen/ria/ZvntjceH8K816naQJyBxTLjrslsn8e3ePmQYs++YTIq5dPYL7w73wxp2GipnHuX9jRf5/wBSuKWPLVOTZdcdtuz6ihcdkVzF+HSfGANftHEqNPGiMy9Tmn1r28X718ddhc8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:34 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:34 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 03/10] scsi: uas: Drop DID_TARGET_FAILURE use Date: Thu, 11 Aug 2022 20:00:20 -0500 Message-Id: <20220812010027.8251-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0351.namprd03.prod.outlook.com (2603:10b6:610:11a::13) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01b31674-f0fd-4872-cce1-08da7bfe0f80 X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YCxLWJ/Lcbi4DSXjXUF17JApacrGUubzLmr+PNBxWRhL6dyCVYubqXQTEbWxudCSfP95sHyeQL9beX5EqItcfk7bM7EEVxxUdOd8/A19/2GnNzFE6PdU1/tCOP8EeDdTgYzamyfrB7x2FoDAuyCQnq2aETi3QGFk6szBVICucv+URrGabrpSeDkOHAhdu9rCtEPo99r35Btg4UMyEyS27tWhF44VoYGwuUdGfAnY4oVNj3VDS+9yf+Wh7G7EFo6U4v+aztN6VF3w2XxaHQ8N107Jb/CMG7ta67bNa5GWZ80dFH/AcavIOYBZVAlGytig54DW8ybZfKCeYpCd33dfXqRvSOgwyaDz/jd1yLP4lzvICVCJMiHd7RwxmxqExefU8edqozpcTa+C7jhe7aFuc9szBZ9ttz2kpI7or+6uozzGQCck2/fzWbd8Loe7l7sRCUAKV7x83JSw2wKdU4e1EC5qxirjm1zrozuWtRk0BEla0LmmdGEK/y8FOr0gVVP1fO+kzc2P3NqcR4kxB8Seq1AqKBvV7DcERVzfeTs1BwkQd6I+N0s0HBpmu0JFJCNYfESPx1N2gsHKEfaMcJOYqTwaYDEztBJ4/PH28sDHH8EO8UNGMeutsOd5UCBVvBcMr4albTriBZtA2XYvrMtTLuXUUm/lh1PrCtArwnkokCvlt5B39chKgAstNdB2UQJ4M5FtpEqhs/uZZirAPlRUR9OX3J7rmzWd2GFsOvPZaXaxpEZZMw1gPJmcMwR1HISB0fpajsg4XculoaSftEVtII7iw9W0k6Reccfhbx+BnzY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(107886003)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gO3AXEnEaJEzC4d66lTvu1RjGFX3+A0DSzWrj8EU7snguGe9rSqN65fozvEMTAjerQQ9u3tW/3q14+LXKu5bUf12b6koQGNgswlRwCR+9ADkimE1/UoQSbXafqcoDOUcOoMhuKXeG9soRsJ05qZDlM8/79flNlKJ0b0ahK8T7sERDdVWNOJm203zBz8pE6ECMRQ0/+xGcId5+uOGAjFYBt6pxD1euiouOB89R4fVfebHkRMbV+EsvOF4gBYKhfHxbGE752DUMzcv9221Tc/mtSla9j+q8XpsHAA+LZmc3APASqgHD+5FmuXzFBowx9b2X+S+dqEAes0gswbVLla4VL0VSOQ9nbZYnisebgCOs/xnndgkbLUUtMM0syOrFEV2aIe6H2v7MWZw8xEQiCBZ0EN2tQL62zOBjeg25Bxkx9qsQXzvk5hb0qPlOo8KuU//F0NDHhzYshjMR7Q2OULgz8uyA/6CTqlZi+cqBFPpcsvcxQZIJfRRYyrTBsaX33TeBcHK1UnCRIPoMc2kneBJuhWhf3Fv0+t1dp8/VUhEkJWm+QjL/EKpoKwCMyyrt4+88OHHzCVO3jyfA8e0xP/nNiRgTF7uAe7iXXglXtzpUYk6pxac46fqqelMNkdmYOs+RewHfist3WlU9QhnXVgud1Mby2Y86nXz3iJHPZJTJRqAGMPEAMrVg/X8WbNkVXO1zetrZ3acP+anywPrbjC4wA3QlC/H+8X7q37UJwqbkEA2TDCv64jmY0D5hUzzv0aNp5BTvyzXtyxDuZLnTSXJMPF1I1fVKWOT0qPnj5omRxRAwqMKj/U3wFyk881gZz+yljNPxwbbwnM5gyAY8zWe6rHM2kJN00d7dHx4Vm9CyQ8gjJwH6ncg4ze49PwyYRRtko1ugxHLmgTfuU9rozcADE5Mp1iy6Z0L20x2ft3g1mHe5rvcY1924lKj+BcHuLJ+AMreZKcpYhe/9nn2J2quKBeyALdMp36imDMQVauRgKKEFzwpGLHXh3lQUIs87xB4D/vjmd9BSc8aLpq7YXznznGEmxqs4dSzRdXz0pdmpmrDwd1MXpoo6CmKjT6VCFHh3kq6PY8RO1eIOWbt7efn2nDmHRpHH7qECUBhKKQDayymrKtSqb08grf19yaCzZ94o8hD+BKIBQAnLzwJ8d5TS57njVaKi48ZhC1OxyAsyQfKmr4Ch5QiYkEqLKsGsPDcRuZ+ptYFVD8uA7V+Ua/YP6eU4DNr/gEJtT+00onlqIHyxf22pPB63TOyQk8LuWXhHyQWf+bwmj6iM/7gKQEKK/gtQH6ksYBzsrt78eawPGQ31DbplMgT/4q+g3wcxKg+x1VU55FzlfYzQRAhokIBxHBrh7KZ2h0Tee0rPsTBZWyqaEzdPr8kRaPUlmpImeSru64ozzwx5pxfq6mY+L/mFcdwcnFkekKsSnFUe/3HXrxr5/f2OkYuQGDH26aB7zpFy+2yqxEVApYWV4RmpTfD7JzeMGWe8MmKAa9DadewHoAgYUpRaWRCURUPo9LT0YFT+7ArrF6NSJmrxclQMLkvutFY9pVEuouk5l9X8ZUegq47xnfFIDiSgVA08gTvvYfqeyTPExq5T1JAOzlSb86XmQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01b31674-f0fd-4872-cce1-08da7bfe0f80 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:33.9605 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ln0zlFop3z3VjfqUo6sJX9VUQLm6bT6Q1gdYTNlXnkEJUBozQgv7Mt7wVF60j8VFYeGBEHKV8JelVY340Atr54YydjwYHL+QH5JGWZsNqEQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-ORIG-GUID: RfQryHBuvTrGh0CkNutdXeuPdlVPvx47 X-Proofpoint-GUID: RfQryHBuvTrGh0CkNutdXeuPdlVPvx47 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for them in scsi_decide_disposition so it results in the scsi eh running. It looks like the driver wanted a hard failure so this swaps it with DID_BAD_TARGET which gives us that behavior and the error looks like it's for a case where the target did not support a TMF we wanted to use (maybe not a bad target but disappointing so close enough). Signed-off-by: Mike Christie --- drivers/usb/storage/uas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 84dc270f6f73..de3836412bf3 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -283,7 +283,7 @@ static bool uas_evaluate_response_iu(struct response_iu *riu, struct scsi_cmnd * set_host_byte(cmnd, DID_OK); break; case RC_TMF_NOT_SUPPORTED: - set_host_byte(cmnd, DID_TARGET_FAILURE); + set_host_byte(cmnd, DID_BAD_TARGET); break; default: uas_log_cmd_state(cmnd, "response iu", response_code); From patchwork Fri Aug 12 01:00:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596984 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED0F3C25B06 for ; Fri, 12 Aug 2022 01:00:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236141AbiHLBAx (ORCPT ); Thu, 11 Aug 2022 21:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234164AbiHLBAr (ORCPT ); Thu, 11 Aug 2022 21:00:47 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDD977FE5F for ; Thu, 11 Aug 2022 18:00:45 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN5hAS019416; Fri, 12 Aug 2022 01:00:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=S5XtHvE4FGk0qeEmstVIi5UIXEmvMgsDAjLUqQmTHUo=; b=quO4xDw4Vvp5Nsd7pVHoSXKCwbTfQg+9XF/9gEX9XNwLKCcNnAfeJRrhD8n+MxLJud33 XKwzLSBkVAx6eiXMu71hoop8Ytp9qsCECQXWxPgT/Mh8yNbeJwtTB4HgV0aCrMrA5Lzw 5j8CWa9rgwE7E3Wg4OpYDN3dAPAj1RQramPpvVfYjQriEKY1wrMR423969WP0jXaJ3e3 Fc013xhuJDDntuA/PyYZP2EtzZl4nv1SI+AR/j+emyx+Qy6BYpF6CzxGbEKT++CWDq51 6iQlW+eNubXnzUrWTxWoxhobiAWSgkvBBA8A+6h5rR3RjQbh2rOFn83aVI4sUQ2R7WHo +Q== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwq9p2vn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:38 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C0L3aY004961; Fri, 12 Aug 2022 01:00:37 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2043.outbound.protection.outlook.com [104.47.56.43]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqk6c68-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QFY6Ib7WXL7ZNXM2Jq2pakTF92a6KYiasfhzFALm2/feZST+ZT8ZSCg/izjujLEIpG5GTbqGUQnZ0gi81D+xnn+XK47Tu4DMqiRhWB9Jc9T3jY6FXE83XRWt8vijB+khJKWCEcFAVACVgVgeFRgXCHx3fGaerJTNzfvUZHu51jUi99SDPmf/wrvsnIg9CeZtZqdi6Yy10CzdG7j2jtbvZDKiLZe2QrpUtHTWp6BHjHQPnBX2oYMHr4tCHtj/QPrUqCbQlRPxeVWcPzeBaPeTq7JZvAvzwghERxQXnwpe5778b6IVe1pAVwinHon+C+6Xo0+KKK5FsoQqNeKiml7ElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S5XtHvE4FGk0qeEmstVIi5UIXEmvMgsDAjLUqQmTHUo=; b=fLclhJZCCaR1CHh6xQWyxQzkFcdQlT4G5mwiQW+jvEM0XWG5rvVHK47YS4sr0qcswIcF8o2qT3T99KZodonpU1vCSHvOjdB4lZaVY7Cw9CAp6w6sDjA7scuit9tHdCfSi1gyBwQujoNp+HP2bS2WVK7Sbnv2SPNOACskbxzDVS5GJR4IH629+9lLurQTm0dE/Ktp67l+PI8zHa1jW2i2F+NGtGcLeQPdeH82LhXS4PtyTD4QkAg2ugToT8c1MXduugRC4g4R8S2gNT9P1r9WTRBr8Z+2ePIt2Bea1jm/swipchLfBQ4JHV6agkdJBAvNnw8E7eXOUueP5HMzu/7Rmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S5XtHvE4FGk0qeEmstVIi5UIXEmvMgsDAjLUqQmTHUo=; b=sbba5Vayotud9ILCSwnpJpNGAPvHFDxY0h08oppPgPPA9eES9Z3kk1hND3EWyREh1zHCHGl0InBgKC3PSbIvBNoYbLouPi7537ZFWZAUANC4jnlllV8nnQnr0K4y/cYOpx/czG3F2TOX/dZFSO9KkNAJBC9YnMS5w3pD1aJlEmE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:35 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:35 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 04/10] scsi: virtio_scsi: Drop DID_TARGET_FAILURE use Date: Thu, 11 Aug 2022 20:00:21 -0500 Message-Id: <20220812010027.8251-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0007.namprd05.prod.outlook.com (2603:10b6:610::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e969a95f-7e1c-48fa-708e-08da7bfe104b X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fXr/o9WEv6WEg3My1OaG0aa4n+EM3z2VOcM6aMaWujHA0TA2VnHnl8qa7oo9QKdP/JKDDP1bwbIaUUArpNVbt6gotlzT8yhBmoU3GMJRFgB1m7dOoQfsA0RjV2mKAxDJRzXzmj/W0y4ldkFKVuYnOKjyYooYfiAxuH2SyiJbb14MrRgKPug8Tj/jVgfQnHiYtaDwG8kE79Xsc9mzm6PaY1sl4QrNCVbk1lYXtYNGvVTvug2VrGPb1qCAmhDMBSdLqhyFknE6KLGh5MbjVoNZ+S77GOsj0qrhf+gmiANGfXEzZUvacyxvjxBXneOTllbRfYVdfP3E33jBOf8sigJajvaHt26xiUNT6gtw/fQwqOTO2e+74tb3VvBB1oU5RT/G3ulociS34dtPkwENJFKFSfotyOu5wQ86yb+6+/7VPeC+jgeHQZME4aJ2PDeNj7IADWpS+t0NeZ0bwlVErGO9EXw+gP3Swln4KCO5eGAoui3EnF7O1ffFr1bpb1xvjBXnrsOK8EYCxMZ6LZmnElpyoQycQvCSwgwPircpO/iH3LyzERc8upV6Gm1n9m8wHm+IAhlnOMYBi500X5MS5GXfIDZNCSKHbCR1ZjA25VE/AFC0Sa909/SqaEQ+uPJ8UpLbnN13AOX5AW6XULWsVm+SEaOSJ56qGBzZ2lbK0KFAkYmNyBSKNir0Ahd3Zyh++kNHQexwKmFDl3iFa3lpx+/S7jeG0VV1Q15BKJKAVyiJ8A11zg6vyxIeRFsOsKyh7BIH9E8kLIMjJMeha69gy13lkeB00fgm98e6J/BmZO8uAB8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(107886003)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5xZYBGDRjmFiz0Ig2YySJaIdJXcrm41/LxZGWWRTWf4Pde+sm+C87rBuktI4bp+2bWYKko5Fnld9uhS7yg0BhUKYeybMLPHkIL1sfjOj6b3AHGOuNXIhfg4ru1cuzoj7EZqdXGUHav8K+fYllQ/G0zOtepwUGuEDBAfvZ+4vEnnBGN1DVANUWj1qKqDqi2qhp3i0vv+L1OcnbolnLMh0T/AZAV/EsWcxEe6TMQ2QfMGiApNs2rVZOmTQfVSeM3Z4twqG4jY7/GEgrvMvxe54ZrU8fNZdmmXK2vChcSwnTgdRu0msg19CY4zJi0ilF0z/S5dYwLoTHBLt0v9d9w9EUlj0k7WoBSBIHyyjEtm8qZ0KeyC/dzUGx554D1f97wgj9gkuaX0h2pVCbiHYYPHYdW5wYPHPyL0yGlM8Z7LlYPreHLNDNcbCYOC4JUxR8JnZN7PsKjzHZMrD+wjDVZW4rB0ftsjuptxjXWsoYLL0wH5uwuT9SNiFCKb5f7bu0+TL2G3Q/xP2GtQQFiyq93JIIqi5SNa8SK+nklY6offssuhbuN5mnb6W99RVSytXhkz/UnPZen5wjxu62ppupUwgs/cjY8f7TyroXu2Ap3lCdUTY1eQo6FXd6kJRrceZHTQ5Kgi8dRX9kT/4EyFqfqXTmZPB2KAy9dS/tUKH456LfBEPD+qhbYEwTTEZOM6diV+CS/JIulwcQZCoxxwYy+sGZ2/gNdkXESZ50aqrI6s5N+KEn4FfT9j35bwrIIIT3xzAInfWIN3ByfqjMyoiVGlJJptQNIcZDfLcyJKU4SPC8iGPxCxsHvmezQsFkINKwUKKM3vDYaPGAX81AZL7kOGF2GFnwHvZE0PLzDTaNlbuj+zQH0BXklQKBV6me3yCOwHhx/eXPSrooW7YpuqmspNS+IdwtWTu7Ghdo+oTmzLZdBEepFRPXsltTJ+xEqQZooTeEBaaxkVYOvXI8C+0BOpLCA0BLeVJrptyhqaxbpueUCxOCEzU5MsBQv+jivEK3L2ZO+VPgbPI2GGYdXUBtNYMgzcTd7/9xwwCb3m+oQqN8sS+IwdA4dzRlWvyJhhnxgqRP/L4sl/PFsUCiqw9bnq/1PR/hOCLQhtucvwaqbDuwwz+BJSL8GvJL5o4MGaLfv+2c370py4bPoFu2v5V4t5MroEDBmUrqfDKhLtLp62J1RL6+oRWGNbPnZIwnP13taxeC9BMjSZ/xsZpNujOV3OcyMETKq1lBj4+ao9/e/1MsVV6Fhb8XzpVNJjGjNRc0hxLfr1CRr+fqVwfeUdUy9/DPL5PThKTW99cTCEJqK9d3h17GfC+j8o6lXHvHyWoyIoEsGr//SXMUhZZxqOQb2MS3gFuulnfWCFd39dSndDS9lhj1nOH/4XHsLI05v090OdMrNYiP/Ae0YiqUo95k3TuGmsHFH0pcUzffJWzjR2TtfBiUOllgKr9jKVE9ILQ5hphgsq18TTcI3O3c/tyJwqhQ5HWld4RGLHAfK3fmmp2FwHh7HzbwNZtMD77NzDZ++ekNy2VwpdiTPTLpGLi5/5sAxUNkJB8pfJNu0ASk4EqPw+EvEpZ3iLW9BBIvBZycoBQh/8IF5kDoyDOsDe57kmMwg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e969a95f-7e1c-48fa-708e-08da7bfe104b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:35.2885 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5SPuVUhagZDpkm01X6JnWVYdTFKSBkHnefPhGC5dwmBd45njJ9YR3IkDj3S3F8q62oYhE7WD7zlMJWmXukyJka2jXjYXkQF+I7FYm6pbtcg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-ORIG-GUID: p37s3yyRG0r0JLcKBoSh7mypmj3exgMq X-Proofpoint-GUID: p37s3yyRG0r0JLcKBoSh7mypmj3exgMq Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for them in scsi_decide_disposition so it results in the scsi eh running. It looks like virtio_scsi gets this when something like qemu returns VIRTIO_SCSI_S_TARGET_FAILURE. It looks like qemu returns that error code if a host OS returns it, but this shouldn't happen for linux since we never propagate that error to userspace. This has us use DID_BAD_TARGET in case some other virt layer is returning it. In that case we will still get a hard error like before and it conveys something unexpected happened. Acked-by: Paolo Bonzini Acked-by: Michael S. Tsirkin Signed-off-by: Mike Christie --- drivers/scsi/virtio_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 578c4b6d0f7d..112d8c3962b0 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -141,7 +141,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) set_host_byte(sc, DID_TRANSPORT_DISRUPTED); break; case VIRTIO_SCSI_S_TARGET_FAILURE: - set_host_byte(sc, DID_TARGET_FAILURE); + set_host_byte(sc, DID_BAD_TARGET); break; case VIRTIO_SCSI_S_NEXUS_FAILURE: set_host_byte(sc, DID_NEXUS_FAILURE); From patchwork Fri Aug 12 01:00:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 597190 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71B19C25B06 for ; Fri, 12 Aug 2022 01:00:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236225AbiHLBA6 (ORCPT ); Thu, 11 Aug 2022 21:00:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231609AbiHLBAv (ORCPT ); Thu, 11 Aug 2022 21:00:51 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 769487FE5F for ; Thu, 11 Aug 2022 18:00:48 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN5Wai004258; Fri, 12 Aug 2022 01:00:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=6ELxXuo9fXh2p88IjvMMNYMDFgBH3sEDgouflvGTb2A=; b=EktpQXnkpCWB+I4COhJBMRlTZhDjg0+wlOJ6Vq/rWThDzujdWqTTJiBU6RxdXVX+PAxp EWIw3+qV8YT/mLzJjYlAqzV+3AbtKx29H/24pN3jqV6pg/y/WG3c7Q7UycsDMLJEQ1+y gZG29UGgJPEL1A+jQ8oWZGbZU0g6ptOmiT1D0WQjBbPX93u4G2ZMR0hROZBEdbtvA/Cf PwqVWipn4/zPmYLtEq/U++ftsEnj01+DFd2GWJ69MSl8cquKgxf7o8/h/z7QvAyekE1y bjLNbsvwHJtQzzRxyB0oWNyrMP+pn5JUncSbLw2ftN41WI228DMS//Y8t8DcnwkWmNQP Yw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwq96bm8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:38 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C0L3aZ004961; Fri, 12 Aug 2022 01:00:37 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2043.outbound.protection.outlook.com [104.47.56.43]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqk6c68-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JmsR5OAUZ37aTE1bOuiAXk1Rw2w+zAWCh37J3fqoqLjJ7oHD/AhlslOHx7ZrYbtodrfS5luXgaycZ34lWX/uQ5PImLvpT4GRI3IUy2qdtBEr7h0qzwjsOt9IlbvGx6GPPbkdgHFWIJIIzm7H3FsoV0U2mOJaVhZX6CfLIEW6lA8DUpOLmC1CRyexYhyxuMreQAYA7BZhDhkvdknqQh3HLLz1JJYSYkuBl57qAUCtm0k9RJOAPcplNOLkP1KB0ZIz0otORRSOFcyDIgWIwsyZ/slMEovE0bespe60UjaMhP8KzShvr0TeVlgVkNPLLA0BUIEGKWOynmG6rbNfpek2DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6ELxXuo9fXh2p88IjvMMNYMDFgBH3sEDgouflvGTb2A=; b=IDWTN9eGZdKP5A/mNLZBsEwO8QMXlQf8d1ceL/ZVkd9aiTAQ0UrxI0RKJGT5+issngNbfeqsV/h2/tyQW8NBBZajfhRZXcRmT2QhtvriTa89KdRF5dVDpiga9I+aWCcb8To+9GlrH0HFUi+uIugOoTUXB67FHfG50CvHpwNGOgSKbB+8S8NEHqOxQYDmu4uzBPk4jLdcVSo2NF/fl1ySHFF1TI9mmZAgN3t9Q4hCrvRUeYVVIX1B1wCQ5yaomK4XPiBRWj6lffhd5IFhrPpwtVf2DjpBHyJC9ifmK6IH8+Ub9p9wTF5g3TGm6dy6xzWe7JhXx8BrU+AZ10LIj9WUnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6ELxXuo9fXh2p88IjvMMNYMDFgBH3sEDgouflvGTb2A=; b=WfnOEFxSRI8IIAAz5ePKqyYu/LqUCilj2u10oxqIRvy/W2NB1pLtrh8V2m6DC7k+Mr6ztrDA/RdmcieJ/souPzWEOGRgUB0k5UQnk4o85fBkYHzwgZUmrPO/GCqn8bsCY8cHUw+JcSwOBq/CYhv8wP2ky5Ldcq2ODsYhgSEjljE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:36 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:36 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 05/10] scsi: virtio_scsi: Drop DID_NEXUS_FAILURE use Date: Thu, 11 Aug 2022 20:00:22 -0500 Message-Id: <20220812010027.8251-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0013.namprd05.prod.outlook.com (2603:10b6:610::26) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9a80081-2d80-4a4c-1442-08da7bfe1116 X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mscyRuUSkHXz0Q9wA6fRE5mkxQQmpPw8Tdy+8PKNMBXZC36no9LpUpM45q6KeWAllI3KQMOwTm+wtFtw+nm5TMcFUkbUIgMZKGPn5NhvXoqgY7cT8/9EVY1zsZJa8sjPDxCrzok8d0C8E5Ka5Wow2V7KS3Lk5ha4ESCNLA4Rx4uxCxnekUijIVilNHvb0tWS3RIlGf3wbCN9JAmB0hEIsBA19XE5Eiej8Jvwi1vdHohSbkluRPWsqwmp/gNp38HTR5Z6S8sgC/sCZkrpYIeG19o7b7puli4qIqVlbTFl8Efz67wK2qskJ5Ta/+7Y/Ug5BqeMQ2peGTXZZq4XKnWS9OD6EcK/OQe8HVeMO9jGEkF8QfkGLnFHNhGqBC1n5fPMqGV4w2zwdPCyN54dGqpkfZ+FdlOu8RrApX16Nzy6pMLoTy4S3LW38RntnSP2nSgXtPpxeJ42Px6qIYEUxBR8BnU+puqmN/CX097i9sgG7aJ9P2sZROvl+akeKuK4jVgMMwyWaDOR7fHPijmj6xrrA0lMN8YPgZ3i9K7Ofu7ruKQ/vInaGI1iG3f0LjyRiJikegZqLKrlh/tfq2WKw9ML6HuksbLBF/VXBRjruuOEEzqVgKRDFG7Dw1eLIxUFChf6v+HBNKBxqxLi2PY8nlg4FuCFNTfLPL2w+w7/IBGHkuO4WvnirVLV77GGhC3JV2hOx3Br6e2HWr6eLcGUKBmkwW4EXf3MAFn6QByBk9Grp/xDcjzz7M6ZfqsbS/Oi3kncK96Ds+t7yGm4YJLb2X9F/J9tvVPYaOGTWAwzulx3+xY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(107886003)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yN0ibnI80OD0t3ZCljoUXthdYp+7uRnNtpsnSWEc1cUZ5aDce285p9gGvqkNoeX+FpLJABVSAUeuuKhJMKD3jnwcmpOTvo0EJm8UM9bA6AAIa0AleY6Q55H3TEiVAAmK8CWLwGGyo4E361wg/6d9DXreTA7KVTG6d8nv7Idp4RyMQiPOsYuaEqWbQDpIY3aXVpBZsTLNWTUMIYrPudFDvFxcyAXSqSwYKf350PJRTjlnYy5TbCDGutACUOEuHI+rEoJRAZMovwxelvM/vVxnPZqxdMISnk1mIQlMB6KS3VJbpIG+HI3TKPMeBtmggQjtptGRqpFNJhKVNch12k6ZHvMjjN9QmsdFaQTeZAT8VgaBRe3ayaeNVmF6rupaMtdHDvm23QaeIkK48HWQnEVVUxD/2MEI6C/gAiGhweEhmoobIh+kbGwpwYrmXGNxGMOIom7Rbyetkb/LVzRORWSnlLqq+0L5Cp1UNiACQsUhx3Ij3zpL2aVGTqtW1jC6Q+5d7JnxSlkab7rNNAcP8V2+J9UI2qKrx3CR9ZOn1GYudZrZQ+QZPFBTkUJNN8AFLaHSM7v4UDpWL++0FxiRu4bHLJIyC2YBvFs1Dtnidu50RHITBjPHKP+bDOT3F2FGKA9XuWdRqs8iYSDejYzZ1dIKigxdAkvZaanukf8Se+s7INZ86HSBE6yQ2T1Seupr08Pqd3TncuwDkEY2KlxaHRfyDDa+NJghrIHGqyJfW8UGF4UIrd2uuu+NLro1/VBEU+metJ+5QYj2BFSRhw+/uP+OnAYPaogx3AZjTFASHzVHpU/qceIuGwMr2FzqH7IryzBusjOCh9cSqx/VjL8qKhssvbwxJXEzrqOOdHjMD7V4TuLQjMgBR/gSPSlcLeuLXyKST0Y8Mqvnw1Z0b5iji5Kw5GHdmMCIxFlvY2nVCYo9v++kKPZmOSYTmSQGqIcv/H6k9xeTv5j8bLRO3n+7udAXLp8EZ36SAzE//NDPmWFtykcYwfpgYj3Rm3aoBfhQxYjY9GscFWNvx0f5FtXLbw8hph2tzrQFY/Abj/ZqUw5C7DON+dRK+5DtDg0K2qSdSF+yP3hbQZcxVsTlAdEKC9LjH85tCJCuQ6o2NW9aq9aj/3l3Rc88O5Zsc2jb4IYw2MiONZzw3GZYOHrWjPIOU+OnUXrXDfzZMU003UdXMnRMphwE8+dZ6/4KRO/dcQnSWWy/rWK11VZN4YoYzm82N8OMUptZ9IPbE0MJLdE85xO8SjrSA23vfadeN+8Yc8ZHKImu1ZJj0qIzzACigkLxPkDuQx2WBpaRj2TLyMeT4lxfV71ZSCwhSUhW1zLORQdH0R2zA5sVXontZuRD4nRLrXSRQ64RWuazoFGpbwbuUvvm5g3GCSNQtLqP4YNrLyizfWzVcj+ULnO8MZYifydDQcleztz7v3uTtLc9kCeK1YPAv9YXSdrQxciUdcmd1nQRZajIGSRjT13eDXWumb96+MhoZBqdJDJ1Ctxn1ML/Ut0+7M7vEZrx8OHWfiaJVRDlIYVv16CTkfQlX8s//KsHbqjNNUEKOpwCFxeZTQD354JuoudZF+3E1oQqZt3MAFWKaI/HmLoIcpn1AAurJ3taH5wo3A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9a80081-2d80-4a4c-1442-08da7bfe1116 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:36.6478 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0ohxpJTz7sOjfgpTwfw6NaUMzaM+gqCNHjv6UR1dLNDimWQxcbj28DiPWIVcyleHMzBqdd+rgLZhKcqhNu3gjYj7riLp0EFUorkvTUhgTaI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-GUID: MyEu_YNVFfUFMltduWt-a5IooH-zDimz X-Proofpoint-ORIG-GUID: MyEu_YNVFfUFMltduWt-a5IooH-zDimz Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org DID_NEXUS_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for them in scsi_decide_disposition so it results in the scsi eh running. It looks like virtio_scsi gets this when something like qemu returns VIRTIO_SCSI_S_NEXUS_FAILURE. It looks like qemu returns that error code if host OS returns DID_NEXUS_FAILURE (qemu's internal SCSI_HOST_RESERVATION_ERROR maps to DID_NEXUS_FAILURE). This shouldn't happen for linux since we don't propagate that error code to userspace. This has us convert VIRTIO_SCSI_S_NEXUS_FAILURE to a SAM_STAT_RESERVATION_CONFLICT in case some other virt layer is returning it. In that case we will still get the reservation confict failure we expect. Acked-by: Paolo Bonzini Acked-by: Michael S. Tsirkin Signed-off-by: Mike Christie --- drivers/scsi/virtio_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 112d8c3962b0..00cf6743db8c 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -144,7 +144,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) set_host_byte(sc, DID_BAD_TARGET); break; case VIRTIO_SCSI_S_NEXUS_FAILURE: - set_host_byte(sc, DID_NEXUS_FAILURE); + set_status_byte(sc, SAM_STAT_RESERVATION_CONFLICT); break; default: scmd_printk(KERN_WARNING, sc, "Unknown response %d", From patchwork Fri Aug 12 01:00:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCFF6C25B06 for ; Fri, 12 Aug 2022 01:01:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236266AbiHLBBI (ORCPT ); Thu, 11 Aug 2022 21:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235962AbiHLBAv (ORCPT ); Thu, 11 Aug 2022 21:00:51 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FCE685A88 for ; Thu, 11 Aug 2022 18:00:50 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN6hDq023129; Fri, 12 Aug 2022 01:00:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=r0oH9dSMyw9lTP50j50+DLxE1tHciWEogscZwRJzrP0=; b=adWZaAn2x9hblt9Q36XPB8VSJr2WhmUTh+bJH0ovAsk3j1H319wZ8gTjgzH+QJ0Hfxsz aACjHfpB2fsryg+0TNdlYKqlZxzWHeCFPXEbzw8bhAQ9zL6Y8K2Yhd5w44QJTS1K99e9 nCJh7C/g1HAh0nBfAQZwhTtRT1g1fKudy2m5tx3UtPcHpYtV6nRO9HgSQuf9wpZq4BL1 h4+DrnEDlEFKmWUYRgxmGbIr/daZzLvoGvbECD/9idO27ihQx1S6iCW8/GGgLx73nnWG lY6tWg8HCJtW7v7/Xp8WWIDn50VcZ6cE3+XoPg1LO6bAef+4b8HK9z61Pa5KFei3d/5N Rw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwqj65ka-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:41 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C0EMO8020384; Fri, 12 Aug 2022 01:00:40 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2047.outbound.protection.outlook.com [104.47.56.47]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqk6bha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3rLfJfNUWq+cD8SHPpmBo9kVY1R3SZ2S7QZpofss/nl4LAVyRYYVz72pZeBB0ifk4aDSnWC9vGo1xjk0fOnXvM6SOcEBFrvUAVMVRsq+ugGU5pQ8+0dUYprqm69HqMOYKqUxLfyJyH5WaWs5wQJRP8rSuzqI5i07Lwf2NyMwMnbSm5X8AMp2kBmZUnvQY1Xoa3cmgg6Lvn+FNXELYZcnw7kCFnl8jU6NuhsLAozkaZMb8I6xxXiwfMEjCuCCRDZAUxmWhb2u8qj6NmdTJga7hpZG6DIlQGDqxMtijL1FqSd+Mccw1Odo0uXAW+yr+uLt0v8yWeCy0jpjPD7G617KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r0oH9dSMyw9lTP50j50+DLxE1tHciWEogscZwRJzrP0=; b=OBN1CYfIr6+AXrB0CNuFaJdEFbQO8fwo0LkHsnlmNFxM2wuf8I6jn3h3yn/fsQnwfE7RO/w9rbZQMtYa/KClKfIdTFJjPmnFtNraVYYcyFLjMJmSHspY01egtFLMgXfX2fnpwwoT9gXdQJvuVNxAgAb27raEFBIIk4H95kxnXcm9j5k95JKzbOJIztYZoyOo8R5iWOpCLFxuTcJ3zhfeIFNaiOTGGIqZJaoUKfk8i3awAkq83eUENfg/Ua/nR3LIcZr9iicX+NYAY6MsT5AR+AUUoSd+5qZWEb6NbgAuQ5zwKUXVx+j554Bh3Cg8Uo0D3k8LpRENT9kNHCgQ8eXxGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r0oH9dSMyw9lTP50j50+DLxE1tHciWEogscZwRJzrP0=; b=opkU1hBLok9OV5y0Aj38Ol/7KHV+yoYIx1zHxpcIwS/qgbeRpLN44j/P2SELUiW/R0tuq2A6lWJsmrhDTVm4iwv3C/hh47GXDAsw1S7ItnpNraZxgpPrIGLKLLa2VMXI45iidl4lqzPG9tjLyOdRFO4Df6U4ll3TL8qcZkWwSmw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:38 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:38 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 06/10] scsi: qla2xxx: Drop DID_TARGET_FAILURE use Date: Thu, 11 Aug 2022 20:00:23 -0500 Message-Id: <20220812010027.8251-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0034.namprd05.prod.outlook.com (2603:10b6:610::47) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6069e7df-7744-4628-7c9c-08da7bfe11e5 X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KT4FPFjl+hIhWxQC5RUAdpzfiPRYuhi0caSY6YaL0q3sLQpnoAaPEp7p5H8tk7gz3IdBVeAxht7n4aGCQyt6Fok2lQ0xpdqFsE4OMVvU2fltF9Z4C0xYLu6INMtNCkf1iwbm2lZ/k/Jb49vG7PMA5T/VhUenG8uoG53QnBaTJDLY43uugiCzlh8xy02vcFDPDwjHfZmiIdQJUHsAG96AokVyyB5j1ATVuug/g1IE2X6oieQBNli8FYwp0rBZTVDpRmpqJevRn3DziIiWktXkNCVIDeis4jav32AnxRd6nXaCsfj4xChpJMvVz0QOwMXdmjHdozzPRBkTsgqncxt1PKemwxAg9+JAdVS+aH2ty4B2p5VUSLrxHnKu8T79wNntV9w1dr2IUNySPVy2svCQi7Ggd/Fmjol5q4ECeUNSvIPuK8/11B99Ei9TRzUTI6mxvHqSiwCakKMBtROCdXwdToMyd9KNT2MGdeld6V0oH9/FFDQVKc9yMSOVuidaDPMiZeMJsiwwHEGntmGsKtkSiOGJ+DgIJdAXtbXyEMhAdbr21oaFcHBCmoUvY7HvTO4LvJVzrQ29MSXz6hhWYLGfa7yqzdBgPJmjOVveRk3u7WOtGq/pieUjj3UXbr9jfT5UpwOTcu8VvnrUOCeODCPZ3m0//a9BWcMvCoBjXxXHpMQfl1sbyCroHz2yOX04/fN9JZUeLWE3MT4haMUJpHdAeiDlhirQroh/0G7rclbvp5GpAFlJPm981DKw4ksasFuXEJeT+BoYox2tXwfSnxzslq0mgJ87CEk/UZcGYZNwAlU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(107886003)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sNozBusD45CHumIe5zOLw4hmB58MO97MX37yjJlRTveaU7v3dYkcA4v+DpK/HycAybp/YaMzFE7OivUyhl4riMqNFMwZrFQmkTtuVLuRMGr5MDTiuWG93PxgFslg/usuHWLXVKXMa+D0keYROX93s2/XWkD3NrZuaIJICFQ8Y/s+oSXGXw/LMPX45uQP+hR7arBr0XvVX0bTCvrA4JZydv5GCi2u5HUwXcI6xLw0Pu1XbG0yLj/4euYxIqwaNZJYcn6gKp1wtyCBuY71k24noFPHLCLt7IMDIPRlv5xKbsu4j7PDftaGwp9RazuYq1aYbujxQ8c/EBzMlGoW4JK7IJO6mgZIthRrLRCWoao6lMnGGXzt5AWh0BrH9n036Lse7zsydsbt2QwEnkiuuM8cbUlg6Bi5zdLq709ni/mi77wWRWDNveDlsepE8ULZKfIWruVDGCuQU7YDgO43ZPnAMHeA3afRS66te87iyFGI5qKd0V0i3pzrupMmO5dEXVCqou4lw/+aA0okkKS4FVvbGfleHDHMkot4luskeBTS66BdjMU0604/BxLVGbrVLVc/HuzwhIVGbfzYSxnCmkIAgPy2Shf4F00SO4oVAX3f2IG4OVp1HbxGUXMNx+V43K3W7JzaYokFainw3yVA1vb17ZLZtr8Tsn9d1hRyDaEpMQ77u9bxoucF+3hX6Z5jY9Zgq/aqK2t3Zdhy6eoxPnOLZvnBKDigWY2Kzfo9VRS1BRNpbPzhON7dgAqbwGU6xQNVqzE452txdzHJDbdV2pParvi9myqkamqi3lQopvHTfEezTkHuUawQFyFulQn8Z5Ma0f1rtUTzvhjD1JE9pmL4WjqWx0+sY7pjhdNqkWD+JWJKV0LfhtZ7rptLJy9ssFXLaSL7gmj+VQlms5VmXc4swIoLGSmC0WF8nAhURbiMye32bAmz7VLNCJtX+8V3/QszBjlLddBdoZV2j4K7ymf4IzFJfFNuDG08QW+UK33zP1KbUntn2cbqsNhKQUrp5z2D5ZdxqEEh5WVJ0j1XmAckraHXIb4BD/7mgKluRkRnQrsJ0deT+DgGCNNEBIYvuiNEu6n7fZPJubKhcFyozRbb5MYzD7zfEYkRmlkIKaed7HWu7ahweDHXu9LA79jWaOUbT9hIl2jDJ9Aw1+4iZ42/0rVe3OazA7sdFj8jZ8kfxqVGqVdzyUR/3YR3jf8K1dTcoVyH/4oUB/Y3Taz8Z7E16ya3yCPzFDrp+t6PkKMVmCi1UiBNxpS6QOJzPGy6l4Mcp+y/2XR/vQrOp+BB+VNsQWNqm/hzJYcAQYXljqxR9rgqXMWVoO2j421vLZ8XR3lDfgTPUyopTglKA8t1njVXY97cdCxv2q9C4S9tPDXxtjR7tJovt0+QmDJXdEoQoukOJQQN1WKExcSDpHj+18ThCCklNnNlZBhL1VsveEJt159VKjoC6bNdmCaan5UBKl+Ppzjwjf77uqS1//UEW0WkcTeyBHyfQWcuakMftVQO1EZwzbMKdry82NgiUkeTWbgdn9iYxl5i5f5CqbuIE54CqVTvXv9l4kuBFm/XDIVsHvbx/tknEwwZOfW8T0UM+o4Qnu5ebRiDb7k4u/TwgrwdhQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6069e7df-7744-4628-7c9c-08da7bfe11e5 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:37.9758 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dY2Q1YBYp4R1K+2DcBCen17qgz72RnLXQVlzwqkUWBNHidNkcPI+5YkiA4UyqR8FwqnVsyxpHA/NrwbmC40w4CA5I57R35ePk85qEOIqBOk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-ORIG-GUID: xRPmje_4orvnKAtGmuJuQ-B_f4cHHCKn X-Proofpoint-GUID: xRPmje_4orvnKAtGmuJuQ-B_f4cHHCKn Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for them in scsi_decide_disposition so it results in the scsi eh running. This has qla2xxx use DID_NO_CONNECT because it looks like we hit this error when we can't find a port. It will give us the same hard error behavior and it seems to match the error where we can't find the endpoint. Signed-off-by: Mike Christie Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_edif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index 400a8b6f3982..00ccc41cef14 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -1551,7 +1551,7 @@ qla24xx_sadb_update(struct bsg_job *bsg_job) ql_dbg(ql_dbg_edif, vha, 0x70a3, "Failed to find port= %06x\n", sa_frame.port_id.b24); rval = -EINVAL; - SET_DID_STATUS(bsg_reply->result, DID_TARGET_FAILURE); + SET_DID_STATUS(bsg_reply->result, DID_NO_CONNECT); goto done; } From patchwork Fri Aug 12 01:00:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 597189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35FA4C3F6B0 for ; Fri, 12 Aug 2022 01:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234484AbiHLBBK (ORCPT ); Thu, 11 Aug 2022 21:01:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236162AbiHLBAz (ORCPT ); Thu, 11 Aug 2022 21:00:55 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CEEB83BDF for ; Thu, 11 Aug 2022 18:00:53 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN6AMU002850; Fri, 12 Aug 2022 01:00:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=/9e3Xe/oF1uHgKppnqVP8AMEhWYjF/G1fUqKLaJ7YF8=; b=yOO/VbN+tXLw/FS+DSF7pAzk5qjWsuvc1id585BcqV1WEGXmPZLKV/iXv85AzU6dcTjQ O9jTeO/Nsu4Akm5ANMhvoQBQwSAv7HWmEyOXXrmsyTke7hz8C8lwSuk7WNlPnnaR+g3q pw21TrYlnWTkL8SRkaJhhLLJxQpJjKipwa1POuaru8DLQDifPSYnskCIFEJlWeiwMKsb u4TNWUaa5TJ6Jk1oVqZQp4s7UU6IdZItgmCZvWmaTkIoS3/zqjolGajWhk4xAmS+sjIL uvuVju3NU6JJX8VMXr3wqjNa/PZa1WZ7hNdSGMvJYh/LUwTGXHB7Wi1BOiZ7xM6Ss7xC KQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwqdx97g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:42 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C0EMOA020384; Fri, 12 Aug 2022 01:00:40 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2047.outbound.protection.outlook.com [104.47.56.47]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqk6bha-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g5OhpYfFOlwBnYYA7ha4gYv8DcRkDKmvBvnlA69D4pvRtU0hRg4MEf/ZLZDJVOK5r1onaugucymaII7DHXoprW/4FTkH6PfADbquAqUIfkbxrvwsyWCnqAI89Aagona2ouaTbI9lSmFzIOIs/wgJlDIzgDJVGRQNpvA2cNjpbiawu/8AL31gDmQZqcrfjlEjxx8BmEAj3IyavYg6wmQAiusvZcZRZ+WepCuoHggWFqan4zE4E9S4FPuoyuodHU5Db1SkqOgRa6Dd48PhhBbCy5g9j+GxxbW+0qxonf1ePiCnq2/Qwpcwk5OjFz9h8JVaGIPLuw4ZTH4n4gE2GwBvHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/9e3Xe/oF1uHgKppnqVP8AMEhWYjF/G1fUqKLaJ7YF8=; b=GchI+IkR7eggwWRntLpwGj0uJQLRiWUWCJU9ixTADlHmPUPlNy44lT+pOaeU9pzZqgrK2QqsVcX7dJivLjaFZxDaEHfggH/0h0xHQw7TGZzzaCpfs6EJVrm+dtVJR2XaNc3tx7Ot1cFKdlsgVjqJRurJ7NZLHb9JDo1Tst455++IYGTcP0DZxn5VV8SNDqV8ps+duS8IAfWRH89PMpLnJl2cQwCTvfrC9JOAOzLzx1BV9EfTb261aI3GarM4g5NGJ1vYeQdrhgCdqXGZ1B6UDie0pOyH1wWsXzcBU3sh8V8tKEiCOfZmZH0M1jVFGVk8cxuVG4QpcfGjwx9k+VQsiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/9e3Xe/oF1uHgKppnqVP8AMEhWYjF/G1fUqKLaJ7YF8=; b=SaQTNV/0IWzv1o6DH1tVWd11WdR0AEKJ+aPWfqSKHPF5M7KyRCVid2RHWDDXMT4uoJgxSR8UOctDDk1sbL0nyBPX+C9FoCzwlTF2WKnIthJEZKch8yzDOE3Y+JbXtXTgyzHME90xKId45LZvrVfHTyH2CtqTNrSZY99mx5wcx2o= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:39 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:39 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 07/10] scsi: cxlflash: Drop DID_ALLOC_FAILURE use Date: Thu, 11 Aug 2022 20:00:24 -0500 Message-Id: <20220812010027.8251-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0007.namprd05.prod.outlook.com (2603:10b6:610::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 379f1e78-fc28-4297-5dbd-08da7bfe128c X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2D8z8wflJ/1yjshc0jDPof6crWEMuPyauC4ynW0ri7sCV6EIY5Y04iE1RtFww01ZaHWFwm0rYl4c38rrvg1RJcpzAtPqrcHf6D6dJSxHyGOzHctkpnQ7Ck/nnJlwfrwgUzx3VWmDFz3eqQ64X0NtXjUnvVaIcL1jlPkUFaaLcuwsKIGD6udO3v4BwVhxorZ/v8s2NKvM08QXvsLv3ofZFQTwHN0T0R78PW74Afd10bH1oCcp58kgVPN7CSEFEoNC/MTuLDF2NvN8zCA3kKqRygbgEs+62jJdumAXTIY5A41a3rqrfS0sdBUkgzSROhYqNLDwlODKzSfeP087AJrTnQF3NyCC7epy4bMGvkDDyY9zeKDXuoLFaFC+/c8DIT4+/VfgJd46/Z6V8XUCO+4hWlEZDHY82cih/R4JrYBUIRdsIBCn5TcjseVrRg/y/Jt0W/dOjyKL3pNi1YOaZsNl0rITg8cO28etjjxZb3w9RFKvjBsHggNpRjp34ScHZyIY0RvQsKtQ40LPoszRzd2wi3gBtI3jwyTLvW0nCEvyQB7AEGoGIOGiUUMtmsoGU573DQtGzdGKFAhCneq33So6ifnI0beSgWMvjkzq+2fOlpeOv9OCr47UAU30eoZay+9eesD0r89AA0V6ohFSukb9IE3BHaxk6SRRBKILyk/yIlNlgdyOXtWgvltweZhROpXc5LL2siGAkhHYeMcbHmS1UZNTwPUG+ceeQIgK1Ll98097oNeN0CE+P3Ue+az8MuwdPwOXK4DH6pzrqf3/kCc5q4pG7TmyjqTYDNTzvAfBSnk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(107886003)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1tMp0baQQAk0dS5NqK0u7I05ANSTbnp8S3DKTQBBoPLWZX/6O9NqmhUtKxd4+CVIyfZ/fVHr6QcJM7iDasQFokLo2RLFsliYTonMGhvMasdmOSxkdxLAWGH+Kp7HRBs19+cqlvvWzOYWERZ/y+DTFmf5VwBYXT+17t9P9qWt7dQ+bniK2aWs1TviIejqrjLSOPj1Rf56Y2OSZhTXlYcDA2vPr/E3eoqqjvFdFnR7/gH5+olR+rCxxk0pJIT4T4CbweDq1totpiy8+GjsxZWcTK0unzFVRaMmshe4x04x97ciPfn6GWC/+MF9fTMg0w15w4i0jXsT64NEygVuuizEVtoIu7sRCi/s4N3gEz85zi71bvgCFI/UIofaC+tQ6R3viO7OJagyv7f6c6VCVa6BQBXpu0KmwucRCBqQagPjmetgSgjI4KG9NU2fErMzhz0Tra5Wi0eyKIIAAYnqOL0Pyz7u32ibRj98VLqAT6f3IZKjJgGjAr35bUcvZlvcC3sMEbsclM6EJ5kLW6ZzMN2bHdgSo+RWeDpVkm5J7oY0M9gBONhQmtGMoHD6XK2PBQgOxYvVy0nU0GDWsspTTwl1nnMgW6v8Q27TZdPVSOarK9W+DsRbb6nsMQh4c2YqMjnQeFFIPXls55pgnvRD0LX4gnoP4yPgYhI2UUuumfQx/a9kbUqbBO8mldSTFP8iqrDMztLWB697hmBw11QGnkv/1oFBOz6JSAd80HF7bDNAtWHs6vQSH7Vl4ZzCs0XQQkm+zpKRTYy8Rhwy2c8J5A6xkuDQpQ69S2MHG7a3tFF17qxViAe5YTKB0gSwKPWUOxy+kf+k0mrid85da5xijYsNJ+nxQ9/lMyAd96NAjmoj2hHurYLUSLoy938Mod2HlPXE7gtDt/kMLG8Ma1Eg9JcMdVdu8NHvz34HLzSI3diCzMxh28hshIJm7VxCPxv0NTYtOT7xqUskuTy+EhnxifV0UERZoGsK1/+cD1WEd+NkvKARPu5nnilDsniQ0rxkEijBgK7h4N2DUo/LURUawrDsY7lftw4tzDWERqSZ2jLDYROYMgKoRyJOmKnN63Vvqo09UN/Ofz34MLZ+lH8l0SCcRRQYAdNTvVrkHk68b/xX/oChSZm70CWfNL5OBdTk8d3jm9khAbL08gJmpTffu+Y2Xr7w7hlZhjqtOUtz78AudGq3xYiI3pdH1UzWLTf5Xnf7Qgq6gsysyFe4XGpcEn9T2gG6kv6w92zAd2h+5qsy/GDj8NoA4Hv+Oh5Kp32aB38uF3PNuHuU8Z5Jx0CBmNJ+9qtdYaS9SWpfK38pAKyk1qQ6+keenQ9oHqy6tEpCVVnMgWpnzbmxX1kPh1wkDCo5gJPnGhPWWL9SmnmF1mQ4MUhpQ3Kw+LgO1iMU2RBokedHZlwt/DpL7OiTg+Cy+RHhAN1QugvozDVdsvIqFnn+ex6M2z3wl6xTMbxcQCoTIExLeMUU1cnRE/WM7drMuRdfPe083Ra+w8e8VlLkF0nONDvbWf5+y7WPXYI1V9nlUyMaqjCGmMy4iqXwNr0abiZJMZ+idXxgcL3sqva7IGhUs76WuEwS/RcapLtsDHAWvBFwt0A90JlMboQBj66O6QBtEQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 379f1e78-fc28-4297-5dbd-08da7bfe128c X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:39.0538 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BRHTaGgakXkZ2BZuidVbbQEZRUBb8VlqhT2jSd1zvGcBzqNGKc9lbwzprGicD3Oj1M3NdnQoiIpohnPUy+2opd6leCHqSPLfYtn/cZvA5aI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-GUID: 3c3ryIKMWjUMQpvItux4fY45xTEeUCy8 X-Proofpoint-ORIG-GUID: 3c3ryIKMWjUMQpvItux4fY45xTEeUCy8 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org DID_ALLOC_FAILURE is internal to the SCSI layer. Drivers must not use it because: 1. It's not propagated upwards, so SG IO/passthrough users will not see an error and think a command was successful. 2. There is no handling for them in scsi_decide_disposition so it results in the scsi eh running. By the code comment, it looks like the driver wanted a retryable error code, so this has it use DID_ERROR. Signed-off-by: Mike Christie --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index e7be95ee7d64..cd1324ec742d 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -132,7 +132,7 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) break; case SISL_AFU_RC_OUT_OF_DATA_BUFS: /* Retry */ - scp->result = (DID_ALLOC_FAILURE << 16); + scp->result = (DID_ERROR << 16); break; default: scp->result = (DID_ERROR << 16); From patchwork Fri Aug 12 01:00:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 597188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91841C25B0E for ; Fri, 12 Aug 2022 01:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236262AbiHLBBP (ORCPT ); Thu, 11 Aug 2022 21:01:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236246AbiHLBBH (ORCPT ); Thu, 11 Aug 2022 21:01:07 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C47D194135 for ; Thu, 11 Aug 2022 18:00:57 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN6Boi010965; Fri, 12 Aug 2022 01:00:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=RU7aQJ08CXuNCZ9nQecYARbikW4uJ4g4tOmLmpkuX+Y=; b=sSf7qH1jcN1VkogxrW+ZIsIPpCipYE5NGMNnAvPFOPLjc+ZtvBw0+8CcLxS+hrJQxv0v zdSolRQi+7gr0Mg3wI4MapjOlh+jJLH5PGgE3rV3SaS9lpQK8YCAIh8+p4/sE2ZPwI32 V8M7nccApaRhKb341AmynsLFYfaqmDBYjVMAV3XFkPtqKdxO/iWA8Pbt/yXtB6h6Qj0+ KCAHIl475ZSI61hKduJhKsINKvtZ9gGknVk2pbhqnXmWTsEc4T63xt2NVylFzS+JEmYO M3+Riiqu9oVRPFXAgDD/ppSQtzqqPZf5jGE/AvypokBradJwMrPyPiR7lYLyiusPJe1A +g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwqgp256-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:43 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C019dA019052; Fri, 12 Aug 2022 01:00:42 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2049.outbound.protection.outlook.com [104.47.56.49]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqkmy70-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OcZVnVU94tnbjPcU2U9CpQ9BtVrNGhc9dIXo8MACz8A+7tzQ74eHMfFn4jV0f6ca7z/7OkTj5NIlCAgd7LfwRhi2+I0j0IEdofLQFKqfuZe6gXERgDpRxsY+uLVDVN8Qhgg/m36Q88CjsbXz/9ozJiHphccR6Lg2COTEeIpc0WqzL8UXWS3vgttOPhjcvg8quH/Pti/tXmEsOgwjPDLJR2t0cEDgNLX9601tE81aWiKe8IaHz5G4Ld2QTm/lWH7gU9nFTH0+W0bIcVD3xqUrLHZSJBUtjxj00g627DtR5VSLPgIKKxMfJQzXL73syK/XveUccNTfW1vpovLnNvT4nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RU7aQJ08CXuNCZ9nQecYARbikW4uJ4g4tOmLmpkuX+Y=; b=Mu77Cp0lc2fqJV2niKd5MIQhHxiDU0SI1KppZaZnEfsHwmGCueERwsLW/g8XDELZIaufR822Tv+GLEXQKP0y/9g76xi8M2vLW9dPtGsPZp+nraBsXg1xxT/wE1FRLAmgqZUrP4RwDYWd8Wdevfbz9t63svDU5nf8orfoS+yMUV9GXqtSUHt1x5xyIEEHI5qblgP6dw3LuRH2PmzkfaAqzWgfNV9UeswV1WNojN3L+R0uGpxeo42qMEJAFHq2FMPwylewJBqmq4kceYUkDGi+M22vaVvt/ECGq7TV1kgEj8JyNuKdJ1ucRjIJu7jERm/MH7zUg4URAPQzEm4KjJWTYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RU7aQJ08CXuNCZ9nQecYARbikW4uJ4g4tOmLmpkuX+Y=; b=IQv0otmhBS3w8nj0HFQvhgpxzLqYSsq86Xwd27khHcplpY1aHGcFEJiKqwZjDWKIWqvXkdDFU3I2/BdqhiPpzSEvTBVu1lkP5tFkr+uNVzoJ+reV1Ez98RHWLh3jlsT5u9/exHTOhffMrasYL3IyWQ2X13s66rFoOHmU8HuBYZs= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:40 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:40 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie , Bart Van Assche Subject: [PATCH v2 08/10] scsi: Add error codes for internal scsi-ml use Date: Thu, 11 Aug 2022 20:00:25 -0500 Message-Id: <20220812010027.8251-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0022.namprd05.prod.outlook.com (2603:10b6:610::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5a21c63-e9e8-40dc-d87a-08da7bfe136e X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BPiwcU41dlqolIIkI1WIU2nOn3iY3pYhtW0dwzbug9Kc1lYWa2aAjoLB/RaMJApXozAD7XAvmACIs4EZ47rqnO4PAue1/aOTmW7pd+l58kGPoX3ZHFU1u1Hw08wvTw661LpbNp5+o3y1ZaG4AHaA7bLQZaSCbb8viGHpdW/L8bmmD0hx2pMWepUf9fVeGWQQ5lnQdH4fAgCjnvJok8jlgTrtIdGT99voBqNXP7JVS7alVAcC17TWL2F3A5fuUfI0NByycOd9FAYsUTfCbev8GrJFR9nIm1bOdb2XiFOshKKsMJdqG9Q/QLk7e8otOhSo7GkASHgtZfF88FBIdNrlkBoYX0s6RxeBpswGsyS3bAqBpvW55C1Og3ZmLcG4T4d4P9BWahwz3KCk+DAElYACajAOLreKALC3jDRP2HBz6q+Q4xOGOvVXAer2Z3yzftIfBWLtXsEUUk6E4VIUA06f/FJ3k3bfx8xPg0gkpdwLB0lG2s13ih8GDwvsTju4sM6SobM4c5SaYVw/UlC4nd1Ztok8ZLnN6zU2FqoMxu4lC81P6S0RU1HEwHrJoEd7gsfsLsLdEMK3CNqvZjNuSOxd0HXJ4fRQuXnnCwCr0vz0Fo4SeYO4AZISE2MYUbTEpost+EeRC17EdPXm8v4/cqcbZogq0U5CFMjn9jVhmAa4Z04FEcEG/WhZAyS4LY6oSU7RZC6XKonyIYEGivo8iWK5sEXM6StJVd0zrgxsYohYYlbzJU476oMmNFQOeGW/Xx60XGnhteVq5dGAFtpCuMS9GTcL+bmXtBwIGw+KSoRm1is= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(54906003)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w4Hz/tJXHGvEIuH+KDqR1x5pLfQ28lp+HIvUGtzE/nvqFkjqvvTh8lU7eM/nMzW38XgOP8cDgX25LhosIRAyj5IR7Kq4t9qVlWGVEvrgfw6ihU9cQCKGbeYa8Gegg4OJgzpddJcZSxapEdYK02PfInq8xziNz78SObnSYJKSs/Yye1rez9/m8144pf4QdAYYpKlN9X9tJK8F69Qr5erA/kURCzcYQRgRQLjbuyLSkHsJFoBQd1ToyJyunmHrAuQfpTFbcI+Ckp/3Rdy7jQldngzDp7YeDKJpmk+0+SUKVI0MHDKoZ35RKvlbITmpEalnt24Vx0ZPLkM1Om5xFoZnACme8gv9Sbvm/iq/N6aeE63NKimQKls/z3MgWQzZM2lVSWD3aMjCM/oq1mwjmieGN7Tr9QCY2W1/gZJVmLqeHa4RNUP7mzG9wV3PcHIiE+NN5FXQakuY6c/xAhj7y//IfzLhUmMjGURuXAG/HQtF6UVVFc4u5SOVLJ0AAHbJwtoOCVWa2xZBXltFB/u3BssHMgzPM7Tbg6L5C6hUIqk4dfa6If5H/JHw69S0gItbbk8QxdqsJqbNRcMlenWu2bzDc/FTZMl993/qUYhv35l7lcKfgziPU2bFoqTd2HiUfg8nLSYYHiI/CHOGQvV6yGe33JRQNI5G5RenngZpN2rvuoeFNB+hZ12btRjabWtDz8P0P9qy4REIy5vT4pPho/hGsMbe1Sn3gF7h/XOA9skQlapkR9emb4CLG9Y92v2oYWuDGiEbH3jhlulcJcqp/FY7SaJp/+hvMVZSUmhtatpYmGke5UzN7HeSjic4XeGONf+RK9vR7rA1ua4E4uW91q0C2i09ATyBp0FB0G59nCt36DQmnOjKnyTbSufwSpbE/77pfi7isGQMJjY0Lw7Nm9y86rwC0lyzvY3VQOEL+L0RlWC8weEE97ym8vlyTlTJHi9LhtWCyd4H0fsDsc/8i1JT1F9Jn9NeBVqCwj5GLjV/c1wrZnLrlPwbNyTvIsGnp2XTRjTbDfoKYCdhgCAWGk09+gjYLUjGeuaT49gfm+xre+rGTI4aTwM9Y201+jB4QPuDoOlgNo9Ebos3k47jf+Ie+gVHjNDEbK8jbKCuiBW3pvoTjTYD66kX7hWlBOJMjkvu4yOg7ryWLwS+nPKkooBsHAM2awm4SJz5sDgoVEaKcgjcRb45X2KKP1EVa/gHXJ+0eIsk0Mw1AvEaL5G1g36YtK3b0Vafl48UKLXevOQXGSKn6ee6nRbUWL/y2T9Q3FKXjD7yeBZtl0/4EYKt9bAxSpoceZQyvrfJDvzHXuEediuwh+kHmEzxyfzz13NyIzRBW5u6um+IyE4GrkJ0NbLRJo+kMgPNAtwMLwYuJCOV6Wn6D86iF28lQClYfJmF9PXx+ubu5c1uEWKs10EZ4uCjnkd7+Nod8R82RjDRl4F5VlWPA37zHvie5XZ6ty0+wfwBX2n+df3AjJhBV1wEC7Qz9TofQwLYUmCtGfkac4ErkArOFAiHmOc+hShOqC4KG6miTcqrtM6+yBaFrJ3dcAPaR38zStkdha7ecBbTTrj8Ca94vfPct5k2Eicp+eBUp9PVVXpjyW4HfmUuJ8FZ7XV4uA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5a21c63-e9e8-40dc-d87a-08da7bfe136e X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:40.6162 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: to9mKKD+VTyQ7LuheblS15PKidQtNJT3Yn9PrJJVW+S8pa/ZxUJGCVnGy/vU+DR9KTb8u8Mc9zn73IbeEChb1sxKaIMFTBB0tcbN4KsfTm4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-GUID: 398SZF5r3N3NpEovecD_gaesQIdq2tG- X-Proofpoint-ORIG-GUID: 398SZF5r3N3NpEovecD_gaesQIdq2tG- Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If a driver returns: DID_TARGET_FAILURE DID_NEXUS_FAILURE DID_ALLOC_FAILURE DID_MEDIUM_ERROR we hit a couple bugs: 1. The SCSI error handler runs because scsi_decide_disposition has no case statements for them and we return FAILED. 2. For SG IO the userspace app gets a success status instead of failed, because scsi_result_to_blk_status clears those errors. This patch adds a new internal error code byte for use by scsi-ml. It will be used instead of the above error codes, so we don't have to play that clearing the host code game in scsi_result_to_blk_status and drivers cannot accidentally use them. The next patch will then remove the internal users of the above codes and convert us to use the new ones. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_error.c | 5 +++++ drivers/scsi/scsi_lib.c | 22 ++++++++++++++++++++++ drivers/scsi/scsi_priv.h | 11 +++++++++++ 3 files changed, 38 insertions(+) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 448748e3fba5..d09b9ba1518c 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -514,6 +514,11 @@ static void scsi_report_sense(struct scsi_device *sdev, } } +static inline void set_scsi_ml_byte(struct scsi_cmnd *cmd, u8 status) +{ + cmd->result = (cmd->result & 0xffff00ff) | (status << 8); +} + /** * scsi_check_sense - Examine scsi cmd sense * @scmd: Cmd to have sense checked. diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 4dbd29ab1dcc..92b8c050697e 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -576,6 +576,11 @@ static bool scsi_end_request(struct request *req, blk_status_t error, return false; } +static inline u8 get_scsi_ml_byte(int result) +{ + return (result >> 8) & 0xff; +} + /** * scsi_result_to_blk_status - translate a SCSI result code into blk_status_t * @cmd: SCSI command @@ -586,6 +591,23 @@ static bool scsi_end_request(struct request *req, blk_status_t error, */ static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result) { + /* + * Check the scsi-ml byte first in case we converted a host or status + * byte. + */ + switch (get_scsi_ml_byte(result)) { + case SCSIML_STAT_OK: + break; + case SCSIML_STAT_RESV_CONFLICT: + return BLK_STS_NEXUS; + case SCSIML_STAT_NOSPC: + return BLK_STS_NOSPC; + case SCSIML_STAT_MED_ERROR: + return BLK_STS_MEDIUM; + case SCSIML_STAT_TGT_FAILURE: + return BLK_STS_TARGET; + } + switch (host_byte(result)) { case DID_OK: if (scsi_status_is_good(result)) diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 429663bd78ec..2b9e0559ddcb 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -18,6 +18,17 @@ struct scsi_nl_hdr; #define SCSI_CMD_RETRIES_NO_LIMIT -1 +/* + * Error codes used by scsi-ml internally. These must not be used by drivers. + */ +enum scsi_ml_status { + SCSIML_STAT_OK = 0x00, + SCSIML_STAT_RESV_CONFLICT = 0x01, /* Reservation conflict */ + SCSIML_STAT_NOSPC = 0x02, /* Space allocation on the dev failed */ + SCSIML_STAT_MED_ERROR = 0x03, /* Medium error */ + SCSIML_STAT_TGT_FAILURE = 0x04, /* Permanent target failure */ +}; + /* * Scsi Error Handler Flags */ From patchwork Fri Aug 12 01:00:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0754C25B06 for ; Fri, 12 Aug 2022 01:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229524AbiHLBBQ (ORCPT ); Thu, 11 Aug 2022 21:01:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234493AbiHLBBH (ORCPT ); Thu, 11 Aug 2022 21:01:07 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D85085A9B for ; Thu, 11 Aug 2022 18:00:58 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN69SK002833; Fri, 12 Aug 2022 01:00:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=iJwwINlI543lcOaATounOylhj+uAB+yZj8+elPRRi5c=; b=0fNrJ7Ue9ctTMdbhWqwfi4nZvkXqfU8LmZuFFGEpQG6/qYPzSGdpUH5gx+vXbLvXQvHY q8Yy9pA6qwrsc+9j7opalUkoNasaNmFNP7HPC0xNjkfjwu/cR8iDPQMTc7N4rTTKpn4f 4MDATlSaNYHgmjejOIt0cKeoYqMnxjcBV9RzVAOGk0TyPKf2JUNzvk2J1cnRzE5m+Q6O ArAvHQpDsHz0ZQ+Ay5I4etLPtBW5OCux8tQSFhNyCPxe3pAFZlwDhen5IpGwBjk4jklB YrqI/6ODV4tf6lBKENVJNC91sXHxL+Hxjpxhl3rnen2r5mqwf7xXWPCwqt9SGTSWcXNq Wg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwqdx97j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:43 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C019dB019052; Fri, 12 Aug 2022 01:00:43 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2049.outbound.protection.outlook.com [104.47.56.49]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqkmy70-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hD2Qg519xI0nXqKx6s1S7lm5kehip7efnIQd6RMV8xQQ5OWZH7Lu5ixVmtHPyWo5uf7TTyrMny7Y+3TOCmo/gxPW4HDvkpdQ1yHO21h2Ssw+s2uvyE/OKhEmzeMx2w4cfnzY+HcXz+2y57bcWjwDnmVRiSkoCdMzBuE7OYaK58j7OCbIW7U7CMujpvjDHO+yIx+2HjCsaVK3TUzdFVLv09813ZEj95knxj7tahgUhpMOmXsjOIJG7v9M9kg+pCV4cW88TqMCfJQq7SIs449zaCdYqd4U2Oxs03XoM6DWjVSkZrSD3mLyv3vrj14Dsf60tX8ZDcnOSmeSahYyrz6yew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iJwwINlI543lcOaATounOylhj+uAB+yZj8+elPRRi5c=; b=dUo5LOfNR7ckFVL8cTewiYhnBz6C9M1NV4DRsmFdlTRUwjjh7vgZPedSywBFO9idhRW2v7thToCtov/ytARXU4lJ/gf86CawNCcH8AhY0TbQkxHjtvh/M2DXZ8Ivo0uxDTlklQf6u2ds3yCj+MpYd7DKXj7Z3RABpKbONJssbJbjmyouJTXFxSjeQy6yE3eT/aumWf4LCqHF0fLh80OQKQDmycf13lHsIU+KgOe+ufsqfYaNkv+6oK8xzrp1YirzmqqwUjNPWavCQwykaiOoeFQWCPK8r47cHR3sK+GS//24RgJrc8+eUkEfrM1ks0ShY0ZjADXp8HsHvjBu4E9GHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iJwwINlI543lcOaATounOylhj+uAB+yZj8+elPRRi5c=; b=nDU5KTzfWIeGP+KC/8ShuqQIUqyBoztupGCRkjvFmL2dGkU/azgg5dnrUlDM8IHQG+ynwT8E1c1GzNL0MYnj6LaMS96n8z5b6RmKgQ0T5AJVRTxEA7Jzb0SV5/oeHvv3xJkYWrtu8bO+l7XkKHxEecb+NUKlZGYWpy7ME3y+NDY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:42 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:42 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie , Bart Van Assche Subject: [PATCH v2 09/10] scsi: Convert scsi_decide_disposition to use SCSIML_STAT Date: Thu, 11 Aug 2022 20:00:26 -0500 Message-Id: <20220812010027.8251-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR10CA0030.namprd10.prod.outlook.com (2603:10b6:610:4c::40) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf81b392-6763-4ee9-0567-08da7bfe1443 X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8IfRzSen5kTl8ubVUsG5esReQIrGkikhHPtWEDat+rFciNVQDHs+F+hZK1TC7TAF7ZwCZIslkZZQ9qUIQV2zDACw37R3twZKT/x8uk1lUybks1U9KtJheIXqtY/1MAjodop3fyQ2zLaCO+qxSh2UzkK4ayOVCG9yl7/ihR2YzwxvqvienPpCYjlQJO5KfkJ8S9vseEKhY0GW7/yoxVAoJmN8ZaovDsE0c1zdLeT7ez7Y61ivRoF0Wf1a1gXdhNGcag704gy7CerPMs0BiUwGrdl2yqk/P3VMVEVJcSkO3TYQNIcK4r78zR3452cG0AD+QS5V+ot0Lqj5jOUg0JMUXmAuQWHbDHGo9NFhamFnErDgo2htUBgF4OHbbFq2k+0XqWp2nX+nHOmtR60Y6ldzSVeWWWnkks1GZtNnfvcnxelQMPG39+VoLBVcT7jsyittAvAqjH5T4Pq9RUMBnF35buX2aY7NEmhTzEtqP2iHuKRcEFYXyBOtNFn1lFDVWMK1GTr+1C0/Wc+DdwJ30xOMVTDnHzSDINiGzt4caNmiAKNyNJ0+VP3cYG14zE+V5CB4b0vuiKYKJ/yRCJZ3s4raiifggA1Ngh+J8m/g78ECN0EC/OCS47CocF1SZczCwBWWqPsBg0qdSqLWZKtW1fVTeYauRxxYJ+HCvCZFQkZ6BOI0yUN4Asy6Lnv14vwY2EUfjdkV+ETvtAJ5uENxzxqQuFNdXsgQQTnwz+lCcRzV2N75u/pvvbdVxrGcTjPAV32IX3IkivX4UGyoRCHVo67yq+PUMmOMD0dYOLpw/cfDcN0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(54906003)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7Lwq3LjuTe26/JkO1yJ/7Rp6mx2km7Ew9jxCEZ9QqqQoCtAW6p9e3MWts4ToaofyDFo5Y5p/e+DphSNGnMChB1RaD0ic/IqkLQ6Xo7F+PgLLGYdcnZE1iiUouAF96ZEiBoxTrzLLSh/hUOLC/Zeh/bSr9gXGeqXqGTztrJfCdoYUVDZmvO0b774/mYAacoO6Da6gmLgOLN+xYzZt7fNvF7PABbwOcvVzdq0DrrZiS8y1/RuP/wd9SIc38jYU81bPSaIoL3ppVPbm56PFiE9FwukkSNvyI9FadsXlW6DZpJQwm7Hn5vUICqI01aXpN1/SGgxBpgld8wWaSV5BYMtw+V5w3wsAcRsi381DrhLzYEnuOPyj5Fk+e4731wF3yqvo40fi70Rb4iduKHHSCIqIfqNuoXPhjiNL+apJuusmOJSW83F7b3p3B5PzyMZwVOTUK3qrOlqyCMghuxrnynZeQiyx+cbymRWMfvclZunRA8PfoKy9NOsIlvgFrU6B3/URPXvMcbiZJuqEK4YNUive+cL/So6B9VeUEPnMC8iuaZzP8uOIBZg3mc4/xTwedJ8CiGjifJr8CB1rPpy+TxPRki3eQ8uMtsXxXAEHqrmdrMWr3SANB55FQGt5hmRcrOiWTo7mMIVnTLFzgFuJFkwKnsBlajwQTx7PJzrPOOr6Wk8IAZ+jMVEYseZALgN7XCfGU4SXqjeRH8VxatxIknsDfByQesuh+/FNvSofvljqkpy63Lhx1PzeOzJPCX1+44217acqg03zABs7BJDpUsBQ146LT/dRn+vR2os2T6uV5Mkwk2/STOvC+tH07SMP3TWEIf+nTkC6nhtPOsnTKbsxkNKHpgfWFZ37+lLPJdkq9FCLtWkhH5c4VXzU/eCrmElAjLDLpey0CEz7xOGJgS6ykZRNT6gLzPU/3/yDq8WcBn/SnMQN812aMkJBgpdwS8LUIzu3pwN9rt9GFcNohrQgOS2ZhKpzYambAb5+fD0T2wcsm00c4e9X5DGsCAh7nNvGmpYb7OofQZpqGiNwBcJZ6ADXkAMt8Kl8dJxFseOzxTkwHB4+zmnoEZQRwSexuOT0Y5gIppt98tZftlVqaAVh+0CDberPZPGd8ISvreRyUZQHvF8S8uVNmj7YnGIGvhV1yvdajMtSCkTN7ujjIAOQrMA0sOQza1W+dzfv0CMPrSydk936FFVioVit3V8BeknIMSaEl1ijMaCFlm3lU6FFXQdHG/10UJHgqd3D1XH/71Uocg0WxveG21rVj+SYwqfdw3sD5WaZYA4pfOw/40UYYu4G0/J9hPbvONosrUJOS/THy5IsKkkMhWzCSswO3HwKKziOpxNHnRYe8w8+ahiRmFUqYJ+x/CGKXI7DIE2g4d8pmQFW73EyKbo1Ld3Lo4SFtI54FC8sPMpyXon5LTypP3auU0WWUt0PpMX5XQeOHSjXTGA4Smxn1tbrLm4RgU235ST+HrHOiB+19N7wH6q75ytgN164v08di9t0Kp3NCzckeXttHvSTRVa3AYbAsB0M9ximpockM1zb5irlaNUAvPpXZIxrjUlEiFZgb/PxaNDKqwrzrQNkugPvmnw4/mq+C0Fz2INSZtU9oqmNCioJKg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf81b392-6763-4ee9-0567-08da7bfe1443 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:41.9286 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zjLZQ0KavBekninoMrLTrMfY/x08Lnlp3W83D/gxzLl8/JsYZL4GCk2NEVoMs6WfTRYwDaEEBmKDwxDxJwK/P1pixGkub2DFJoB8uOHFdsk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-GUID: aUveQDlDS_st1zd_gRcewRISjVIeWJrN X-Proofpoint-ORIG-GUID: aUveQDlDS_st1zd_gRcewRISjVIeWJrN Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Don't use: DID_TARGET_FAILURE DID_NEXUS_FAILURE DID_ALLOC_FAILURE DID_MEDIUM_ERROR Instead use the scsi-ml internal values. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_error.c | 12 ++++++------ drivers/scsi/scsi_lib.c | 24 +++++------------------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index d09b9ba1518c..b5fa2aad05f9 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -649,7 +649,7 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) case DATA_PROTECT: if (sshdr.asc == 0x27 && sshdr.ascq == 0x07) { /* Thin provisioning hard threshold reached */ - set_host_byte(scmd, DID_ALLOC_FAILURE); + set_scsi_ml_byte(scmd, SCSIML_STAT_NOSPC); return SUCCESS; } fallthrough; @@ -657,14 +657,14 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) case VOLUME_OVERFLOW: case MISCOMPARE: case BLANK_CHECK: - set_host_byte(scmd, DID_TARGET_FAILURE); + set_scsi_ml_byte(scmd, SCSIML_STAT_TGT_FAILURE); return SUCCESS; case MEDIUM_ERROR: if (sshdr.asc == 0x11 || /* UNRECOVERED READ ERR */ sshdr.asc == 0x13 || /* AMNF DATA FIELD */ sshdr.asc == 0x14) { /* RECORD NOT FOUND */ - set_host_byte(scmd, DID_MEDIUM_ERROR); + set_scsi_ml_byte(scmd, SCSIML_STAT_MED_ERROR); return SUCCESS; } return NEEDS_RETRY; @@ -673,7 +673,7 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) if (scmd->device->retry_hwerror) return ADD_TO_MLQUEUE; else - set_host_byte(scmd, DID_TARGET_FAILURE); + set_scsi_ml_byte(scmd, SCSIML_STAT_TGT_FAILURE); fallthrough; case ILLEGAL_REQUEST: @@ -683,7 +683,7 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) sshdr.asc == 0x24 || /* Invalid field in cdb */ sshdr.asc == 0x26 || /* Parameter value invalid */ sshdr.asc == 0x27) { /* Write protected */ - set_host_byte(scmd, DID_TARGET_FAILURE); + set_scsi_ml_byte(scmd, SCSIML_STAT_TGT_FAILURE); } return SUCCESS; @@ -1988,7 +1988,7 @@ enum scsi_disposition scsi_decide_disposition(struct scsi_cmnd *scmd) case SAM_STAT_RESERVATION_CONFLICT: sdev_printk(KERN_INFO, scmd->device, "reservation conflict\n"); - set_host_byte(scmd, DID_NEXUS_FAILURE); + set_scsi_ml_byte(scmd, SCSIML_STAT_RESV_CONFLICT); return SUCCESS; /* causes immediate i/o error */ } return FAILED; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 92b8c050697e..473d9403f0c1 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -583,13 +583,11 @@ static inline u8 get_scsi_ml_byte(int result) /** * scsi_result_to_blk_status - translate a SCSI result code into blk_status_t - * @cmd: SCSI command * @result: scsi error code * - * Translate a SCSI result code into a blk_status_t value. May reset the host - * byte of @cmd->result. + * Translate a SCSI result code into a blk_status_t value. */ -static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result) +static blk_status_t scsi_result_to_blk_status(int result) { /* * Check the scsi-ml byte first in case we converted a host or status @@ -616,18 +614,6 @@ static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result) case DID_TRANSPORT_FAILFAST: case DID_TRANSPORT_MARGINAL: return BLK_STS_TRANSPORT; - case DID_TARGET_FAILURE: - set_host_byte(cmd, DID_OK); - return BLK_STS_TARGET; - case DID_NEXUS_FAILURE: - set_host_byte(cmd, DID_OK); - return BLK_STS_NEXUS; - case DID_ALLOC_FAILURE: - set_host_byte(cmd, DID_OK); - return BLK_STS_NOSPC; - case DID_MEDIUM_ERROR: - set_host_byte(cmd, DID_OK); - return BLK_STS_MEDIUM; default: return BLK_STS_IOERR; } @@ -715,7 +701,7 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result) if (sense_valid) sense_current = !scsi_sense_is_deferred(&sshdr); - blk_stat = scsi_result_to_blk_status(cmd, result); + blk_stat = scsi_result_to_blk_status(result); if (host_byte(result) == DID_RESET) { /* Third party bus reset or reset for error recovery @@ -893,14 +879,14 @@ static int scsi_io_completion_nz_result(struct scsi_cmnd *cmd, int result, SCSI_SENSE_BUFFERSIZE); } if (sense_current) - *blk_statp = scsi_result_to_blk_status(cmd, result); + *blk_statp = scsi_result_to_blk_status(result); } else if (blk_rq_bytes(req) == 0 && sense_current) { /* * Flush commands do not transfers any data, and thus cannot use * good_bytes != blk_rq_bytes(req) as the signal for an error. * This sets *blk_statp explicitly for the problem case. */ - *blk_statp = scsi_result_to_blk_status(cmd, result); + *blk_statp = scsi_result_to_blk_status(result); } /* * Recovered errors need reporting, but they're always treated as From patchwork Fri Aug 12 01:00:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596982 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 040C8C25B06 for ; Fri, 12 Aug 2022 01:01:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236249AbiHLBBN (ORCPT ); Thu, 11 Aug 2022 21:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236235AbiHLBBH (ORCPT ); Thu, 11 Aug 2022 21:01:07 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EFA97FE5F for ; Thu, 11 Aug 2022 18:00:57 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27BN6D1V002866; Fri, 12 Aug 2022 01:00:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=ZcNnnFZCVYS2fHrwAKP4btbO5qxuVmfOlo2VbqzM0tw=; b=Pz7oh1qDF6qZk0jraG8TA/EyLVp2Q70h47wqTUJ+LNmnYzsvHzbrWkyzt51GeM0rUV9t GfoMZGv6IYdVCRKOQnlrrS+UkQLV4hQvXlT6KfFSBdYrySCD87stmsKJXjyCy/JTOjjC GnGyHmw1Xznf2K+1pj1xTjiKAuJgf0rb52bP0foQhOq/hYk2JPKOInue7rmVPdTpEw8C a2608PqVigYg+/o8+L3lUGW95byWmyQtOhFKc7lXJHPoM83oLRJsVTnOeCqO5rwP+TMb pp3k8H0ZsO76BRXC+zyF32U8e0GhtFy4sJ6HluYvEPboVb2/4FYCFqLwBxPsKjW+1L83 og== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwqdx97m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:46 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27C04kYD020473; Fri, 12 Aug 2022 01:00:45 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2047.outbound.protection.outlook.com [104.47.56.47]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqk6bmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 01:00:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aaIxI9ll+dMgBCFtJuuK3jS8nUQsark/6KMDcPzYHarm48h0bO8Lkp8fiUHm1FbC9acKnq9ZDRz2A5TwY7rS9sPJUyEp6prEhARdYi2ENKmD1rAbj4cp+16mhIIoreoql6Qu4L1/U9pKJZsP0+dIGuKjf3UajHr0q2qo+FM37BDljj4Yw6D39gtYCh7uh+lgtxluzlZWGl1e+cYa3gibmvkrXwpmH752cfw7XBle70Ag3RD0Xk25CZizRl9/UZvZzE36+VzmtW8qtof6PCsA2pgYszkzpxaGEeqeR/urQ6eErpyrFputrH6vhZto17vjyIRnXkdacPWPrG5zqQwJCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZcNnnFZCVYS2fHrwAKP4btbO5qxuVmfOlo2VbqzM0tw=; b=KFdIYJaeTE1ajfrq+KjS0alCXc4gp3/bRq4VGwpr06gCZcCZGiTYX2VOK258Em0CC9TMz9lVM4Rx+lvF8ZcLDYLnTeDV1mhob0ifjxKCMDCIawN4uzcVT9xoKM0AChvciFizejENvO6IgbSi+sMPQitaBlyjuo3omW3PITj0PH6/hEcCX9ZnxvXZjhEakBt+VYlGMuW5P33QGp9eGBDur3w+Rr9a0SxyipAGKP8QUeMNG+xLMwmMrXuWXXvcmnuDRAzriqmbkXrmV0ryhEJe2BFoKzk+uliNq3dqYjLdMNvKEPiC31ZIeim80yHiz+Vj2j+7vax6lVK1McGweJ0vRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZcNnnFZCVYS2fHrwAKP4btbO5qxuVmfOlo2VbqzM0tw=; b=Ag/E3tf2orUwiPcVEWui7CI/lD/7Q4ypg6x3Nh2HN/vahvPAVsSvEbHVJHpgvgFOIugbPfQur9bo75NVRRebSovfqMf4DSZ5Zjltc4gIib8ICsAXh5XjYQXfj2JDTkpXXZxbmnkk+5UEQWPwcaCFBI95VfKpalnHlf54bb+VyhI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CH0PR10MB5386.namprd10.prod.outlook.com (2603:10b6:610:dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 12 Aug 2022 01:00:43 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 01:00:43 +0000 From: Mike Christie To: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com, jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com, oneukum@suse.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie , Bart Van Assche Subject: [PATCH v2 10/10] scsi: Remove useless host error codes Date: Thu, 11 Aug 2022 20:00:27 -0500 Message-Id: <20220812010027.8251-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812010027.8251-1-michael.christie@oracle.com> References: <20220812010027.8251-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR02CA0007.namprd02.prod.outlook.com (2603:10b6:610:4e::17) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 036fc111-ae9f-485c-3466-08da7bfe14f8 X-MS-TrafficTypeDiagnostic: CH0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uYQUMyK2sxazxr0dKqqVPxT2LZvBQoSdHv0eYSMeSX0P4d/VBKeLPk5QSJmJYBW0iNFm3ByAtgCGq6YLXsyGW3f2iKiMC4PTxh/4YlhWbZPF2xRMqNAaqJrafn3F/gXdhYKFT5GeLBsxKp8LemUsBAnK5kwyKOVDyqwrdtQvd6Mat9hzomFtzEZE3Q576ufY2Y+ixONciZ3kLByFEaRlFmc2wAbGb20x2+wbdthoCTnw58xv87zDxQ0kOtJ7mwb8P7TfJcZ7yVw3wzFFhfrmX6FCDH9m9PJqHpcsJG7+hNZWkYBOtvRiwvC/W6zMC2Dqw900KfOlVkG9fr427K4NphiumP7yjSkTCA/at+wpdYbi2DUzK36RMbI9wzYQVhPY73FSswQOKZlmEHhvmflL47G95DtobbOL85B+cyloV8TUuz8fAtcdgYwQ94ptRcmItavS5dQwsEoYtxAcu5wkBAcJKwA+F2tcKeDgQDl/z3Npk5KCcR4khF03tjzAANvVT8HM7ypPTzIgKK+86aBy8AgAobH9ZtblTkaWFhpd38W6/ttAZNJ4XrGMEBCO4E3uQCBplMkQCDoYjazVO8JP9xGpmUbPPh3yS7ANHDO47bZrfoG8aoEc3vR5vZEXv1g50HlNY8aBVO8q3IJxHx+d0LgG59n0LnkL6gyNwmTIF0RvHukPY0PYdmKPDgdMN0vEEZYAtwZb0j2nVcfWO02QQDx1qW5XLQkUvvsah0Xoz3yXv0FT/fUPxcRTtwHxclna5ZylncVE6sIkboNnzHYokNZEvV8coKWPUkZKZde+FrM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(346002)(376002)(396003)(366004)(921005)(2906002)(38100700002)(54906003)(83380400001)(316002)(4326008)(8936002)(8676002)(1076003)(66556008)(6512007)(7416002)(186003)(6486002)(2616005)(478600001)(41300700001)(86362001)(6506007)(36756003)(6666004)(66946007)(26005)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fE9fKyL4W4NHe5xpKjnQYEjDq7/wAb+MQaJUWCdb4DTFPUKRnzjKYIk6hZ+3EhGahfQX6klcDQWidMOW8am7XJsossThHWQHKYnV7L0btiQ8S26cvD9kyjaro9fL4+VfoziUvQbWVs4mAzBQQFUQBwB/h+CEvgdQtuvaJqIvN6VhcEEHhVbKcwKqHgyERWTGNI72n358mgSv0ZzAz5H9qYC01l6TiDCLhp5q60AqTU29q31cpCGZsZMzBxyXXnandihGrPkaHR40NZQEYri0lVZJQ+RwioLZBvgF2uPbmBk0NOj9Ux6t7HgTniIQy6SKPWFBtMjH/Q6Nv8ZnCgCCkaAutU6JfUZnVL3oIIL/6pcL2FtL5AQCmIcbMGUAQuURupXD5/3/eJ0VlXv80SkI3v2LVVzOLaekIJQGFx+fnRCCy6RzNuStws5FrMOSQXal+qry+wi2CIN9zXeuy0s3HW8Fns7YV/TKYDrFBJMe+Kh8qvzw9lTLZGNge4F8Pkdbb/i8nlg6lOy2u6fGoWAhJs3WtYWToEgyn/SCTAZoLn2S3zqGy24hJsmVPNKOoF+km8pavVf5NhuzScfzGZn0OvilagCjnT/KEAcGNh25pdaWXexRT/t9AthO7LJG1WPFb3D5SQVPMnYlnlnyROY2/dfd3+8wBMjsz0Crr5v92+hr/2I2OESo2qAMMAcvD/eRQYiaFDm4a2xQYrNB9/KSVc9vUD+5SrJRrHgL03Oxs0ntKAVrGNniWNBX/cUBKPYn9Ng6PxZnDno3UVy3dW/9usQx0rpGdWexI9WZrKQFHYzb8eWVPjsrkj3EtohZcTtiYl+yVBDh09abe9jYj09HK7Ht1JLyI+FIaojxJbeyDxOebYB9zPBwXfWIoZN+3WhdkF3YqCQTperidgm9hGSt3+kev/FqUy4DQzOIpA163Jc5efzkKZu/hJiw0edTSBB9pPRzUgnYaq2mr94erLfMjFG5fqbfysEhjEzA08sr9K6/NYFoaX68S5vFpBRzCqr9imZ7g5Fx4BexiMQy/PJnaRUDXey3zwDdxLw5jBvkPOSf2l4BR4vLpwzQVf8OPDbmmiAqpoFm5uzEST8o91zzk+IJvVXunWvei7FGzeeo4b2ENF8GXQ/kpibHq9ijEZ7b9ZOv/DWaFMKNdO/3Jn7xdc9gY2gTjM0sif7h//52ccIWPEPdRT813fofjj5E7MggQsH6xIedo1BX72Kqz78y7g0YWBJZ2v00YL9Alr2zfUA7tn+v2cQjttqydWAoKKt6OOG27JCc+Cgb8Ch0L6AnAcOu+m8wxexBtjWA0A5vILIocHwW97t5km2ZCqEsBOgMIkR9f9ZUSsIut6jPmK8eN9G+tthCw/1OL+B/hOFf3229hgCefbLT10YC06b//XRi1gvAQjhdMhB+Qyyg0/Ubi02wiZBpll2PAnMfmVKlahamLpS3iHnVb9QJt2l1KYkhuWGg6G4ISP3Nt5skk/2i4iJ1JsMvvTv/+OtCeRxUYOiTNcjG0jidTAO793AfsbB53/TkCtq6RU8qWA+D5YeahfsLGanspfb3YVInRROKxnqQG0ce+V1HP9+QnMLf+IT6Uf/6vCmp3SjQi1QOhaQJng== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 036fc111-ae9f-485c-3466-08da7bfe14f8 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2022 01:00:43.1472 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IQ5pwR5QL/q1WrFmhGjtrtZwxZs6yrrYqAdZSSg/JclAZYfOrSC91XcjN7nXDdx2fNSidLmh8JhzRQJBgqtgvKjaALZGx1ZlPA4ijLg3eLY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5386 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_14,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120000 X-Proofpoint-GUID: mFDs75KZMz8-QppDAogb6VtXiC3KLOyz X-Proofpoint-ORIG-GUID: mFDs75KZMz8-QppDAogb6VtXiC3KLOyz Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The host codes that were supposed to only be used for internal use are now not used, so remove them. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- include/scsi/scsi_status.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/scsi/scsi_status.h b/include/scsi/scsi_status.h index 31d30cee1869..9cb85262de64 100644 --- a/include/scsi/scsi_status.h +++ b/include/scsi/scsi_status.h @@ -62,12 +62,12 @@ enum scsi_host_status { * recover the link. Transport class will * retry or fail IO */ DID_TRANSPORT_FAILFAST = 0x0f, /* Transport class fastfailed the io */ - DID_TARGET_FAILURE = 0x10, /* Permanent target failure, do not retry on - * other paths */ - DID_NEXUS_FAILURE = 0x11, /* Permanent nexus failure, retry on other - * paths might yield different results */ - DID_ALLOC_FAILURE = 0x12, /* Space allocation on the device failed */ - DID_MEDIUM_ERROR = 0x13, /* Medium error */ + /* + * We used to have DID_TARGET_FAILURE, DID_NEXUS_FAILURE, + * DID_ALLOC_FAILURE and DID_MEDIUM_ERROR at 0x10 - 0x13. For compat + * with userspace apps that parse the host byte for SG IO, we leave + * that block of codes unused and start at 0x14 below. + */ DID_TRANSPORT_MARGINAL = 0x14, /* Transport marginal errors */ };