From patchwork Thu Aug 4 03:40:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 595451 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 8BED7C00144 for ; Thu, 4 Aug 2022 03:41:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237057AbiHDDlS (ORCPT ); Wed, 3 Aug 2022 23:41:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231368AbiHDDlQ (ORCPT ); Wed, 3 Aug 2022 23:41:16 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0D373F31F for ; Wed, 3 Aug 2022 20:41:15 -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 2741i8Lh011151; Thu, 4 Aug 2022 03:41:07 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=HNokNoARkreuRPmaLBttJ7B8kDle+c3zaUCO4xZNAlY=; b=jMnfa6z2Pl8ix2dQy+bD1z6RiEcSVjzsqAsk6h+VxA1wyAaUl50VjginE/4+ozBYUwb5 Fg3n+6a852tYQb80U9YLt2LJ3H9s3I3K8HeBjDRKFU/BQ+NQvIM8zq7S6g+8U7uD5SkV pyrDrCM7r7E6lIaVw8ELusYEMZerHY3yO2jkg/Iyc+JliLvMk0HdhHA+6M/XDkd8WHIC 8WMNZ6pJhRpfqVqi0T8LIdShNGj7xQwLuvOqm9z8aimYyny2AN+OXmar3pAg8+3+PgVm BSqH+GlBEcovUI9CgjZd5uc85DzFIipK1pR/rKrCwcdxndXiZ6CScs2uK6FPcG2SnLBL Mg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmw6tkpw2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:06 +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 274007mF006766; Thu, 4 Aug 2022 03:41:06 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33m5me-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SpJ53hnouM79C+vyIgQmbflMNZqWXqGdneOPzPTxRL9WFXGYgfs0woqeI/gp9pksY3rs95M5vnand8u9QJhNKmuldC7GpBnPQLn2k0gKeEpkiNzvZFYtp1NG+mfWLaZyEZRfeGaTNVdjmz7da0xAn4kY/oShSfWSUGR6eOLJGaMnzb0T4qU4TTkMalhP+UzOI/pBDa70xn037z8JXfHH10cIWB4bke+x+jfb/WuX6YoxV0+cdLi8xj+DB8Qy2mqqUnERilJfBshSxfT8GbBjDesiKGbEuxIIeNHiLqqcyZb4j1bT4u347BoUQP39EGyasGfhqJLRlUjfsVNdBjcuFQ== 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=HNokNoARkreuRPmaLBttJ7B8kDle+c3zaUCO4xZNAlY=; b=n0zS8lIr3eRzx9O9TgN0POIxMEb7YAZYTNfwkJQB+47j5/DP6AZLJBVInGm/PJoVEuXDmtUICwkVhrgQAeR8X3C6my8BNF1lbmb7W2gpAT2E50O9hemZsixtUgG5JRkX9GFu198fgc1q85b4dCqcgRL+CEoAmX/hoAFuvbrWm6bD6Q0YhBzo6npPM65mA0ulDsWpoi/EoHRyR70W/HQ/FR4lHqL2dghEyz75Wj7SHmUYLvfiVpYoEvG5BxrlssBEiLIwk1OVEEpU648OPcPLi++dhE6GuM644fonwBnu8KqB5Me61imV2DAkqtKBCmId1/FyzgARGZM6kuQiI2+EyA== 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=HNokNoARkreuRPmaLBttJ7B8kDle+c3zaUCO4xZNAlY=; b=Hj0Jl4oISUwY/07+eTzAMOMxif4Sn+nrOWC+/n8oiEaEwrY7Woc6ZCNdn+PO42nlnf2uKZFRzoXGBjlUfea/ZTSZlXK9khBmYw9pt7Jr9H1QGqHP8l7R/ydeM3AE4ruNBii82d9GqSaBaAyVd4jQNgODCyw014lUUsYHeAyx2yU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:04 +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.014; Thu, 4 Aug 2022 03:41:04 +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, manoj@linux.ibm.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 01/10] scsi: xen: Drop use of internal host codes. Date: Wed, 3 Aug 2022 22:40:51 -0500 Message-Id: <20220804034100.121125-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0083.namprd03.prod.outlook.com (2603:10b6:610:cc::28) 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: a43903c0-931d-49e8-6216-08da75cb2836 X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jcrk623YexYmm4zi+8tA8Mt5nrYIN4FIDMGjQWxwxBOINc+4TZLPd3V0AgoawVZEghnxtnl2zymNmLigIPtv2NhgM8ffgpcm+HBbzR5E8VBABnScN4LcL7v+W9DehMzKIAtSrOGBsPsHA8wifv/AvoISdE8KjaA0miAAIy4CRZnH0UoVSnMFwYRpET2HaSt6TwjPPKAHsLP+JlHBF9RABsapUvlKyUEZ7G5HswCf5gzj1rmEvpjVndun+Y1mlRaa4wSatlaIrlQw2YqrslFQKHS5OXwBgL3QM2qLHdvEhVSbcojVPhhNSoKM+UPNDskwbIqGKKEG2u8E+wLLsh3D1/0gOx5l+7kZAozYg68v1gwacMzeLLD4F2jZL6xciDFfyBHVvJ887EBZumS+RaMnn8K9L/pB638UzV1JJ0Cnf+7ZxLG/val7tv86p6dqhSbh2qpGOtiAOU5gqHplzUUumpyUf7kr2ZHWBbhlpgcx3SJGhE46CXX7w4MnVgWpxRrhRDMuLe+5Gm/gdGgWmrZN63snNI1W6twLVYJeoWonSJhmk3HhXwwfNgHx62fOEu1dcfUNMCyyg047VAlyiGpZO9cTI/5f/fqi6XHk1alLAAYQeEdNedaYoYDQkpt1YYSRzxZHK1Lxj41/pcJo0OLwNbKMlldwE/MKdA7GMG7PyYzrAKDdALsmlTzKaEMHKz6QLcmjemr0J5I/35jTgidgqIz+Ww3UmlSm4HDajCJuChPggBIyq5u1pkGM9tOZzCCVGfklv+7K9rg5zzk2uXf/T2+M+LeYG786cs7pBF7Y/Ck= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pCDKLbaIdeIP6ezJ64jI43Q9Xsk73FM0oo3x1wR+lOMBiWKWGigxWZuw8z4n8I7pJPfkr35KKDHphBCUB9hqnq0Vv2/LWtCdf85Y1BvfiIyS6DRHtLMivYkTvrtz7XlWnzrl5Vf62btnux/kgIbSwL0ly0+F/5CGmi4z5qumcFw7OgyLezn0KFik3mkwWnrrmfIJ0GNUE63LjG91eTKypX6ALPw3aBFuC7MmoZmw4NoYpMETZ6+fskqyB0P7wBNhOMxcpfUNyy/RiWdkqojcgl4Py60UYtyzWzy31rJY0MnmDzllneIX+7TX0uA5KUtKIe5XNndMu6/embFEskbxQSvv8IlxPBukzsPZYWe1fiDjB/RPrvzwTZOY4T3msKKCcNd9bfop8JDC5LGoN2FV+AJ4qEvEIL0T7lOPq7tHlVGuzudJQ3VvuKXCzc56TuNAYV4+eTuTpWCnzNmWY3kROT6b4v8nlTDogy5T91Z6fl0MTnBrFkjrIoiNAzEd+bf9ePxC0+O4iV2IetY340skpshgo4hWjZ+UsbSuTWm0XthSyUeQ2nDkDprRy671RGn20vr7E8vaCtZPGE0+VWBYJSzY/Fw+9u3PwrkWF1G7wxZRxRNCBNugBWa7zh0pNCtjJtJ6w6earFPnbH9M+6bA9Q66jD5CKOl+cF+JwIYvR/3Vkq7LbeEEz76QVVbUSIQg8qooSEMLQ2YnqEL+3SUjJHw5d9ENUITX8irIDn1SAS9FM0jLatG8qOhCMlRc9UEXVRpXF30afNEkgWN/DdIMIPccfaOWcF00493R4bJ1OxM8YYaq/nlAvjiG2E1us+PcadETHFb3ZwEvUR8UmdRH9MMicyfAgit1YGokHzK/Zrt7ZmdYIG/Kpn7th+o5oswz/3UvhoNGKgBQx1ixJZJ9ShWY0QwxMA/hrnHUQ75KHcIyCmXOpWIQTIdNXD8ZuG01ldKLIayoYEZpQfA1om4iZtnUbSuFaDf72Se1352NJ7hbKlmR27FUnoaWZFj+1Fz8UphGKAhbHGW/mnXzQ72b/cYJuZngYqyDO8P1nuBDYOLytA2+CgTKMm15QdVl+ISLKN2HrzAxfxsLfaPJHzm3dCcgLB3pAPCun5xqtHpjltal9pDH3G0eRYR0nxH5QETsiUfykTOH8r9tNmyHe7xsE1CoIizBzc8z2ZFIprZpX8VA0CbiQQ0gLk/7WSACmvjGH7cSSPl4FXp0F2/jA9lFzuSTiRzJHJcn3puDTqAqAK3a/KD33YMJunTjiHdxDCPvU6jiLtRlIK15TKtajoYw2Dd4FOAb/QOfuCZhnw+ZKOXuSC5vi0/ipQafOtPsCxd/M5dFS3Ld6oT9RtkMwfCn3jSkkk6lWxkE+1aRB8UX5eqavuhyWordItaRzQCn5iPxzNK+jtLoY7ZT+2EWqWgiObv/LSyGC2X0z96tEFjJGFoObEA9+zT4J9Qu/Mw3cQBBPmSO7tAnEtMjYyDkqORvsnX4Q1U+P2mGmTMi4v2I7L9XmyxdPnYHiSToF2m6FOi75il3AXshNBgdGLloUUyui+6JVg83vj5/79N3EKMN+bJLQ+DVLWDaXOVh2pTh22rRxtkOoSY/MoRy52PvTpePnw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a43903c0-931d-49e8-6216-08da75cb2836 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:04.0747 (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: up9OX1/nhMa3DbEshHdCpnWHbZ7N79NWdMXVEdAyvRjdvsN/YxypyNR7d3MrY5LaicVdTbfPcoq5hVfkYUCrp6y4trbVI/d94aedJ5vo0XQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-GUID: 1E-fAdwxVJHOQNmZSAlAuCt6K7YEQwbs X-Proofpoint-ORIG-GUID: 1E-fAdwxVJHOQNmZSAlAuCt6K7YEQwbs 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 --- drivers/scsi/xen-scsifront.c | 8 -------- drivers/xen/xen-scsiback.c | 12 ------------ include/xen/interface/io/vscsiif.h | 10 +--------- 3 files changed, 1 insertion(+), 29 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; diff --git a/include/xen/interface/io/vscsiif.h b/include/xen/interface/io/vscsiif.h index 7ea4dc9611c4..44eb1f34f1a0 100644 --- a/include/xen/interface/io/vscsiif.h +++ b/include/xen/interface/io/vscsiif.h @@ -316,16 +316,8 @@ struct vscsiif_response { #define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_DISRUPTED 14 /* Transport class fastfailed */ #define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_FAILFAST 15 -/* Permanent target failure */ -#define XEN_VSCSIIF_RSLT_HOST_TARGET_FAILURE 16 -/* Permanent nexus failure on path */ -#define XEN_VSCSIIF_RSLT_HOST_NEXUS_FAILURE 17 -/* Space allocation on device failed */ -#define XEN_VSCSIIF_RSLT_HOST_ALLOC_FAILURE 18 -/* Medium error */ -#define XEN_VSCSIIF_RSLT_HOST_MEDIUM_ERROR 19 /* Transport marginal errors */ -#define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGINAL 20 +#define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGINAL 16 /* Result values of reset operations */ #define XEN_VSCSIIF_RSLT_RESET_SUCCESS 0x2002 From patchwork Thu Aug 4 03:40:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 595450 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 DF89CC19F2A for ; Thu, 4 Aug 2022 03:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237166AbiHDDlU (ORCPT ); Wed, 3 Aug 2022 23:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbiHDDlR (ORCPT ); Wed, 3 Aug 2022 23:41:17 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4833FA01 for ; Wed, 3 Aug 2022 20:41:16 -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 2741i7a0011135; Thu, 4 Aug 2022 03:41:08 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=ANiaVxgs1hDHKf4bYCoHFXpIzciLxQ3+XBzIWpgyak0=; b=0KR79EjTaLB+Lxd6lZ0on4GVkFVOBf8HkaxDgHGLrM8RzfxjXJFO7AjMOecgUnj7IQhF ZUjxX1cRdCjWFl/tQig5QVZZvrDmDr1jkAg5oyJ3vO17UIZlNkDAWVvbMfD3/sg226hV HgoaTS/F8fPe3cLxLCz88Dxp5CgaeCv1DB2ZkFRnN3jYqx7BFVe4Y/BG5gv9SnZRd5ZP ic/W0RDWP5BKSYSqVvdaY9tb4Okd1wNsNcaiodc/WoDCNvawD2pONSe8KOw1r0UFCoLT mufUwbhBOGQoC3Xl4zQkYsQFDz747IwoqOXzl9gEgATJZ57u8UDRcd9PW0Z8KCgf3yyL 7w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmw6tkpw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:08 +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 2742MXgO014976; Thu, 4 Aug 2022 03:41:07 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33x1ag-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XuUCHbwFTVtS9ISFD5AJOlGJrfCmweiZuWzlGU7zkz/DLr1ulcTrKTpHfBacXHTJ74IHqS3ptzacQqPjx3tipj+F7dts2/fDb8FQhyMAAYCI4SK2LxsbtMIb5Ijc3v0xPSOGYawMa0M3KqgfC2pF5fT0G6iQ+ZqgWvE3I45skByQ5tMIJnDPzaEa9tHyw9bp7k8e0G/ra8T/21JewFh0E+bryzfebsLFfkqG4Yy1MH1YEd7v3dWPcMYLY64f1bjWWt+gRZXVNF4+I6q4WVRLFGSwqzjk2Dpihu/F+OLW8mbIFKnfFqeyK8xAMnddPoON8WIJpIB98mxfymiaMCqF2Q== 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=ANiaVxgs1hDHKf4bYCoHFXpIzciLxQ3+XBzIWpgyak0=; b=DyWDv/YcMcywcX53vyOK/DAADE9fhBfhTHnCnO0jWO332DIIHAAqmCfojUzNof5mLTapFtVNGYpyhRnnUTi8mKhThLlaXAPiU7nrz1TolzrQE336kwbhiWqrYkKsTrHgc1LUFZnjtaOiYl/0foKuDgZkWdx3dSrAQfxv5U6zt9uEK9CVlxTqmS8DOomXg83N1U9Q6vSMozGreWyAMlOgYAgXpiHfQD0SiN3Idmfjvh8socic/rUVPzdfjazo0EwCd1DaiQUbb/sl+s/DU4y4z1oaeLXZPJbw/0XgCbhvPptbqwbzVzwQsmRWmgaizy1jSUBk9wk+dnORi881rhjrDQ== 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=ANiaVxgs1hDHKf4bYCoHFXpIzciLxQ3+XBzIWpgyak0=; b=zDSK7uVUoPaoCZRkrEweVdRN4TuY9jcE2QAFxmcTi4MeqMuiFYhzgW5+sFO7CAn/LkB8BmoYidwtTN2NtAc1XdeXv/iTrGKKIk3ebym3vCmEh8O7aD4+3z83REanHnD8x113HRKx4lkcJMZ/BiAoYWYx6LRR9A/g+mdoCNsxG88= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:05 +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.014; Thu, 4 Aug 2022 03:41:05 +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, manoj@linux.ibm.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 02/10] scsi: storvsc: Drop DID_TARGET_FAILURE use. Date: Wed, 3 Aug 2022 22:40:52 -0500 Message-Id: <20220804034100.121125-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0080.namprd03.prod.outlook.com (2603:10b6:610:cc::25) 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: d016887e-1338-4692-b3db-08da75cb2930 X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6m22KSbrnB1XHOHq7OVqKzeyjX58Wbcwa5EEvBMsPYfLEfS8TE5TXskJAGpdxurJe/aZ1HipbAsE9ef5CT03LyDkXpvSayTGNOziMadl8m6GCpUoy49/960NZI9Spf8hH1iMxwHVRF5LiA2I2Wv/sGjBvXwlU7+r5hsTkDz+l8N2zZUPGEzaxFURIY6oUziVYeLny1kjOifPme3cPMKy+ptp2cLvYZ4ETDb0ooTjwsoZ9XYV7aO4xo7OvzRVPHOvAos15sC5HwlKvvXzbONAxrYa8aHYrPX2WB+ICOiQfgbB5WmP5BrRI2ka+4LjG+lW2j+eBousCG7ggLFW+WrkbAf7cEnXgp62yU/jVJsyvUZVamzgCiT5rbpZWy7r99yF4apin/iSo8iPe6xV8NjOepz6rkg21VTqYGnUY2XpaTI4TJV45lqNSVd7FHYsuuAMTS10mDTAt0Owu6XS8EPpFEi5lPtgOSWQJ/G72uKYyPbLMBbnT3wsPCqzKvYJ8Fpf/eC/VFgCqpUJlmJKvjl8zRpHon9iaV2uUWRQatN1yNx1UgTgFWqEZ72TvhPiP/ji5SlEnGDcDKExkAj8OuulBK4aG33OVKt6NR+Hq1ANyF+CJl7WERplwc5e4bolJjK6FUMjDC8/OkvDWI7+4PT3wyZgDl1Dy1WNRrqhxcVSLz9p3t2MNPGPsWoweQZDV88hAzts2tqZVRkqCXpAPuR5EARuPK1hPYLD5aEhA9LWw6on/Hp0EXbqd3Ycgajd+b6arL12YX7bcNppZFrZeOFQDg5qi72QOhdDYIYrjNl0S40= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(4744005)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Nx5NYtDqIs5geOHzj7ubljsLnX8z8BbSgvf6iCbwTEJHeMlcMblBogorDmmJ2R5OaV/fXA1NawhxxKAicmP0C2hF3quVElOrFkhDmSVc6GLxMfHsoIH1674HglTSifYfUVyBP4AT/B2RfaNywScVGIgVWbTZr4iZx6fZjeRLQDp+mWDATZOsR4aZ2d8vezpWzde2RVdTc71p+t7rIUoGEwFlNnfY7nKB5e+fu87M+nGV/MBQPbeOAKsax1BocNoSW0gkOhemfQ0CZ2x+APnbiVnFQDudupfV4BbFtDL9vpzZHsUvtDmghq1D8SvUMBmsMvStG7H/xF+aWnslfJVlZIHWatjlwoZhcyhd1R1ny5XHbJJkvNOpbeHNJP2Ic/Dv3zo9fAzDf7Rhr7DuQpGkL5IWKjZoc1UTOyAoYWJfE92HRcUnKPUdoncEE94qoujLDgpikV6aoLFBc84Q4EG5hnb6ImD1y9VRJVVIspeBOEGYSf+Vfxm9rFLECs/QN+jk3OjhKpy+OrOFy/ia4NptOUpaMdTcerq1w46faOv2dbipPB7AxCrvChg20D2IyIK0smzfDSjPWfB6X0eV1opQtEzNzTXqbZXQCKzLbSfm8JDdUyoBr/CfkBnOaSoI2OJSfYi01U73/i3bdf/jwKrHdBecWuELhnUYOXiQ1jZwNqfOeo79evErUV14/aNUYquve2HDUqfD0XumVk0YKBL9t6Tm1VV2G1ltSctjYiOuZQO5xjTunJ+KVVtxDYFcOAZeGW86fy8ZLytmc5u1RgWQOkaR6zlgEvhugJ8OdVNeEyW0G1MklzgnhEBeTJZuVe69cGcjmi2j8x0n5WyYFdprsQ8Jx77Z4GxGpxIcDOqydJaCXrnS8uN91SSvis/TEQS7viDiVhtUyVRFwyNHs880pfdMD4Qrs7hV5S8EAI0vteFybbbYH32PnHda/A7cRIUSkstzlrHanVOcHT7pAbJLZdCME/t0zkHoBwTR81CdG7cR1KV83ig4ednOyX709JF0SmyAktPPwlZZwlfk7QULuKu9wJtjTbkT1LgZl8LVaAwabYvfXpnQba0C+qRfUENH3nlgTzi/pQYkY89P1lS76r9ogXWtDkO2f6mWCHguOomuj/tKmgPuWrJ46u+najlqQEvuooXxryCQOSCpDgcnIyiI9f+r2fp5FV6hq60tkKPN9y7dSVpi37CV1l9lZ20bFMymCzyBuOHSlqSHDtRBRw5d/LsFwjzBuBrt02CFLAUMVtV0GDlSBpyN9pknDvk+RSCRY4HVBise+nAx//GHooruQ4XJU9OjqFYGKE75JytzXk96jOuhWIfWulYI7EBfHSTW3FSptoPXVwtNzZE2e+wzRmbxFatgTqnPtPk9nSK9yIu5ZmQI6h+dycdr9rRcy+CLouOuSsFlFX3h8r4U2UZROG2qENdoIYo41FoPE3o+y2qgiNCKVjqshhnlrY0mRuTVkVye8frw/jC68S/jNdQsGZADqccxuU3WTI4+6X4ZMKrD3GowdmymQPZSJseMDfou5sZxSlh+p8X5IlRXEpiLH8ScOQBUTik3GqngPaaSiJZi497VkHkYbgTEy5GKMJrj/HZmO0NfsBQ1qllvnw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d016887e-1338-4692-b3db-08da75cb2930 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:05.7308 (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: 2FItO3V8DXnab5BJO0/WIuwuh9LMyi7jyRKkUeipJ2qX41oX/lUeInfj5gsSqdjWFO3YBWKl+xbMDHGirLMq5a1lRoM477vYGpwjHo/uDuA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-GUID: HfIeL7RlNJ5ZqSiDS9i2FPeR2cSCAI_v X-Proofpoint-ORIG-GUID: HfIeL7RlNJ5ZqSiDS9i2FPeR2cSCAI_v 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 Thu Aug 4 03:40:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596021 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 10727C00144 for ; Thu, 4 Aug 2022 03:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237451AbiHDDll (ORCPT ); Wed, 3 Aug 2022 23:41:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237097AbiHDDlT (ORCPT ); Wed, 3 Aug 2022 23:41:19 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F04703E767 for ; Wed, 3 Aug 2022 20:41:18 -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 2741i3AV019750; Thu, 4 Aug 2022 03:41:11 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=l9zpzpNPOkEh3Z29cHblRapCCJYjaFZP9pMHb9T3qtM=; b=OCcW78yO8IWBa+upDO/qM+wZE7g5lJL1yejnfY1yVa17XvsPBqSQFGTVGMfOklCEDCeh /iWnw8FLi++gL6vjsDuu6ekg0LC34h/sXBsjn0jCvymtpnGW7szcEs1+rnehB+eI8dqq TRzttOD5kq7uvqSUVkOOF046eG0CgAN2A8EoFTAk+vSRoy2ZOhOqt02EmNpQ7XZ11Ume Po+WTBOtJb4qV11AvxesjA8Q1cak3Fnz9Cy0PLdpSMbGjc6pls50myAP58x6ULQ+2rnb 4dOlRc1Sjq2ualsj0P87NrsNGvN43W82DODiu8im1/4i+aaIzOrHC0NrDmnsQaMevI/n fw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmue2uu5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:10 +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 273NSOvP010841; Thu, 4 Aug 2022 03:41:09 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2109.outbound.protection.outlook.com [104.47.70.109]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33u06d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S1Mrt4/y37xKpEVwdMX1JJ1SzAwV/OZlgtc4ft4NGwezKmCbpLzgq6jLJ/FeVLPKQDqOYvK2KTNSiaPEnHO1eQMF7CnMdxsfQKxHXLxs7FJ7OvIy+IYxWySfpYtJFdPu/owTsoGYzdOCafmemjt+tnnPZvoiNrwbVnCha4HFTS8dc+aW5NXk5M4NyXitFcm93UQfPGYtAWJCEdkIU7dw3RLuNQtD7nrsf4I4F6do45D1dyltFO2c2FLvMUkI1HqO8TU0zpNWVc2eVp6RzRbpLAtA7s/eStErfhkcM6GE5UcBhJ2AXpw/0zKbdPehVWKNZSGgjLwMJdi867Um67klpw== 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=l9zpzpNPOkEh3Z29cHblRapCCJYjaFZP9pMHb9T3qtM=; b=Jj58oqehY1yu4Ih0PuRXnZ21xop2P/Xevkfvb2+tyKbEstgX3XfPWggK30Jf7JT7tlxMXJ+qecF51pnjhCmq9k7jriPfFyIJFDpIMD/SzWbjbKS38iPHyyPysf5oWNi2M96pMbMMU2sTmA9lY2fG64jD3JUAD39BnFtp5jyGxXc+GXc7IVWb7x6HDNCXzDFzewQMIKaEbMTSYfsM8+iQtjw9ScoJApsmIGWp1Fa1XaA7mnmkQY2D+EtLsegPnSkFUMd0f3ftvm4d0G6OR+IxceT9kiWEGm5PABBFhGULSq8/yeXZtS85i0Btjq0dN23orqxyS/97uOoersr6xq+Wxw== 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=l9zpzpNPOkEh3Z29cHblRapCCJYjaFZP9pMHb9T3qtM=; b=nivxQuwjZz3euFgfCDEYqQv1kIJcKAr8atDfeJ4uJ+UFRzmt+J1KyJXVaTCFhjZqj41eFdnozKqhdmjcH77iB/CgdGlOGZslh/bAQFLCQg0CjXZNA45nbrk4em7VcGfIRj/fPel9bRV5+r1gJXQdR16R3drObiYBTlvq0qDcN8o= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:07 +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.014; Thu, 4 Aug 2022 03:41:07 +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, manoj@linux.ibm.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 03/10] scsi: uas: Drop DID_TARGET_FAILURE use. Date: Wed, 3 Aug 2022 22:40:53 -0500 Message-Id: <20220804034100.121125-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0067.namprd04.prod.outlook.com (2603:10b6:610:74::12) 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: 9e19ef80-7756-4eb4-2c77-08da75cb2a32 X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cV+mFJIi4qtgrc1QpuNPtq1y+97zf38+BDeKCm/YjPTSb+SReZZECb1pb6REK1X5m/l2/aOzGtUIWW8TpOZ05ulGxLqX+1hHN38r1JGDyl9SDm/e8VL+gZx1JyFW4k9MXCtlQwW34RqZlaKyxF8uDvLdndpybrNTXTG0KmI+USsg83W4f8bvG1OuYfhQD3hMWdat5T3OI27B6bd7IeVDZwN2LIDyB6cFpmlUJ2VNEsMTFQL2HlFB/YTSlW5/sRru5/eECIb8k2Ii6ppsVjTvoOsP+axqDfJXUJYzhrXTWfKGSQJ2vDwOjykWP3c8SFWuxkC+00u6I4OE9b3bS7Lw6PGENh9HkUwX4kT7wVTBXIt33NguwTWmat8srVJCefSK0SZJPTZnUkDdqehEHQTLTaxEw6M/CXhmeoONj3G+4Yq5sfg5eN+zGZzjc3CfW8E11uf9gCkk4nH4ZKTPK5LBTly/5Jk931OulL9Zk2QQh6zqC7ZjdLm29BzF9wvcGb4JPXXPisYU3VlPmFNBOO7XYfoumQY6VMtwrG/7SlMnDCvkfToz1pwhSeisCNzgHZmm75AcmeLy1xGr+BwqBH3YUPeBtHLISCcx9Olq/8sCf4v/DHg5IVw2jkIh6PaP37akJFSIZwJ1A0tpMG8QrOGzKSs2ZbM04OVOzNF/etPC/B9wrW9lXspZXY9s3+yQtzR51nCaO3l0BaTqANBRUPM2Mo4h1zaz1Q5DkuDnjemef6sSIfP77X/jD3kjE/EVavBzRk8A5kHlUMDDej2JKpFPWy2kWwvqb4QO4M/GFfeKCTo= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IdQ71Qd5rvVu1joErav84SRLMkWfioccNZzXbzEpavWpTP2Oc2yhYNiXgcnxitOpLVFJ81cELt/4c4ulHfaiNKZq4QsjZ+Qwij023ACqm1ujsEyawqH94We4FFcMmhldgM4+PzkeNkfAk9v2HcaotCwtoQmUyFhfWy024d7jZC3nw2PNf/p1kUt3j8O+CU3J9j1sGIZVd03lNnSttCoIUBtz84pmBmJPbQMO4zWF6q63J9f7cW+5qXX9hLpqZUzjySkK43/y9cmsVLv87I17FyHfzGwFnM+ZWGpY6603o4GANF93kG9wJrc5pdKqkaWG//RuGsfkETxZdyGSskjnrXkMZrSKANOTqezue/RrqPFnJTjOaIp3Kqe13Pds38cI3yC/PwgA5tq2SdWxTCdfqSslZY88fMr4idGZwe83zviIMcHeQghwoXEDsYSko+ZW3fvIc5ly6Fcz/tqirM0CIVSwavuFk6SBzQ3n6ymSM2E2KLFn+PjqNm1RjD5Qt87pruIn/3PxHvK3AKOQBf9ZRxJX3nd4U/5s86e0wDREktMg1hCORIBNn51CM0p5yM/GgkFeTJ+PvDkj1R4JRLqenE1mNbDzSg7GVtRNpLbaKmshPXVzQj4QySYezbc5zvchbg8opAO4Xoy9A68q7MH7uHl5Dqwmhf9Np+Kx1ZH/OZm6wDfJp7slKDT9VIdhDB12eqkrt7SNAQEuyACM3AHybgzWPEuIgWyl+WwHHAHXKMZ56O8AbjlKYnTzBgoL6T1DSH8lXu9PjIpkMfRiC/p8qVRxdJB1VCELTSSWfPZXYojMmXUId7CjaILpE8+mdsSVyHBlVivKr+xUX2UUJEhtAKIk48qn5RxpKTaXeDNGURCP9eupCpp8XGZeLf1VcBS1S/s9a1uEYNvKMKSGnehPwczH0BpHUFXxou02Yv2DwA4rgrIF4x/zC2BQzIVMXITbV9URWW6XAvtYsxYqc50ntmiVGneO5FgwT/QEJGqx2pGmrtpuRGgIE1I8uq4PKg4u8te+o23yQwU7MiS844wfdNmA1JIs0pwKzkt6rtQZx6CDgaoVZnmetobPwfgrIKqFYelAQGHvtHrkuYK3f1R+4ZoEOyp9FU5/aRIQPYxG7q/Pb/RNk1IuFDZXMDb4ARevhqZVQq6NkArv6VyiLOEKI6xvBkU33o11Ld1zxy1FiOwNEBWdPY4gwW4eQu9ttge2LuqjhSegwS/TuqrB0I3SqixjvMW0zeYIsByNFww3E3ZHYGpwtlgrbwr3q2vJgjtFVnvYDQ7Jb6gwG58WzLA9gI+JXM+/448rsC0QJOoHvUujH68Bdfq8a4kqxa0Uf27MJZ4GYYJ4nT3976It+IOYBV3IyfLwpukywqFS1YHJeDNtrwfscEo0VjEon2e8v47yy3GROSf5qmS0RXj/3IfBIobO85B7bWx1H9+SiWpIl2+djpRxfNWkE/LZoqFPZV+U1uQfge9gpdUXSrovLUtAhuSMmEEu1EqeMoF3xQyQ2pYsYxeZIXeoV8AHLNMng5lDo6+pn2MD33Vo5O1hA9VdMk+uN5G9eZf0HBNFZKGqMosbTy/epw0NkvfCqzsh41SQUWLHfl52axVQQM28v2Tglw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e19ef80-7756-4eb4-2c77-08da75cb2a32 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:07.4182 (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: LVDyhBE9yOWOPEMzy4RXGOYFzOidtjSefu0JbA4lIhgXw7AFFhMQahgzq3n316ifQEnHc9ZPQ1l6QquAUJLLwZO9htSF8qC3EB0r9bB8ezg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-ORIG-GUID: zmYo0WayZl5ghblvrCjqpl0gIVgYQEek X-Proofpoint-GUID: zmYo0WayZl5ghblvrCjqpl0gIVgYQEek 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 Thu Aug 4 03:40:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 595449 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 2A3DAC19F2A for ; Thu, 4 Aug 2022 03:41:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237610AbiHDDln (ORCPT ); Wed, 3 Aug 2022 23:41:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbiHDDlV (ORCPT ); Wed, 3 Aug 2022 23:41:21 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3721A40BD3 for ; Wed, 3 Aug 2022 20:41:20 -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 2741hsFM030432; Thu, 4 Aug 2022 03:41:11 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=KP/N0PPw2rrHGFz83HkXJJPj6wXJBxnKrQzrD1MUNgo=; b=NlK9ajpbldlGSnrhWtJWM0xBtc4oJKEmYw23MCAeskjULF/BxTqDXygyCerJ80NOE13h KfWd7JaqdLSlfE6yYhoPC9HTyRS4Xv/zFAOJz8ENGoGlhEfhXPYz/hyjR+LzJFHF2DPP 2JQi0oMR5y/yr4IQFRIP37/ZJ+LfdH+BicVHCj3J/e670oajHdF58QK+63dn3sVx01SQ K5YkE6U0uScqX3Mbtp2TJHwXVoxDGnPzsbEUCBnIdxkIai/Nss8911EXvhbnUphSk/l+ XoAFWnq7nP/ZIwASapGPyeQx8LSYbNm9u9itd71QEYFLJZP+LzRK0qFPj7LXSPwsClWL kQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmu2cbfke-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:11 +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 273NSOvQ010841; Thu, 4 Aug 2022 03:41:10 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2109.outbound.protection.outlook.com [104.47.70.109]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33u06d-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iho8lriPHcnYIM398nxnfZGDp840bODrXTPPogsUJGBujccWzqDPkpvvvrZ4hth4JR+5QfrgnBhpUb8nbw9IxKdHJhzUfmMX2M/txBPCJ1Rzgu50US7WnQMGauPD8nmLMc+fj9fnTyPDnbclrc2MqCcJe+rAr+Tykk7TAt8iXYRLHNFhnymN4WaSFc0dLskWmp9x4G27lYo3jFwfZmZI4GcUSj7to95vuneB30Js5WiETcFEN4ivne7C2SvJocnNlQRWG5VD+9Q4e1xsTkJ60l0Kyum7LtTW+zgvK6X+lsmgu4rrJhh5VgNTjyIT87UGTk3xhrdMZt13dfsGrtQSJQ== 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=KP/N0PPw2rrHGFz83HkXJJPj6wXJBxnKrQzrD1MUNgo=; b=ejWWhyYXg59iYCmZtXbU1G1oujK6NbxaXcqndHhirzYUNbWlDr1+msFvEmpx4Hj7xDgNXtx12tnVOAYq2pGQHcR3apDPK9GTIQHhna3xsmB1y53Mv7zjkSXjCjvzgnAVt+Ur1TCPSHEEiTAUdiLkQUxduM5CwhV3l0ki5WWc0R06NEnOHo21m/nQEOSJuxhEchjS2vcKcqi2wyMxQFZvkTQwySkSm24SRCLYWi3wdBx5RwHTRjWHkjeRyZoulj6gbUn7Z06L6bHWea47xMWueiuI+WjfKOpryI0b8EC/ianIDiH+JDlwrv94TrjMMvkgNqLKFhuy59QI3wh/k2dLRQ== 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=KP/N0PPw2rrHGFz83HkXJJPj6wXJBxnKrQzrD1MUNgo=; b=Y8B8YtroFETU6cbd7k9NDPgvXq4WoB4sIlMY2m/LdzeCObYnFylVx0NvvsZC6+ytLEShcOEbEIxDu3D0xyLgAn3wOfAPYkvxY/t55CJrAs9PwA6Zwew88bYZlYxsYT8haMEGGx2rIZh5lixUeVB33gxmDIz9VhW/MM/9HXOHgKY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:08 +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.014; Thu, 4 Aug 2022 03:41:08 +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, manoj@linux.ibm.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 04/10] scsi: virtio_scsi: Drop DID_TARGET_FAILURE use. Date: Wed, 3 Aug 2022 22:40:54 -0500 Message-Id: <20220804034100.121125-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0238.namprd03.prod.outlook.com (2603:10b6:610:e7::33) 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: 7449c7ad-c424-4f35-8261-08da75cb2aee X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H5Tv7fKzbocr29fRA27nOjzQmE+8nonfzKM5V7vq4EFHCXSL95rgvW16Q8G2b983ZeLALo6dTe++LcByH2IEHkQSTDy7Sh+yMERBXDOvI8NwlFdTyVvrXH1HqSdnUXK0h2R91zjSb0wmfp79tKgEGPN5hReJiU+RktHU7Oqgapm6NJPKxJjyt8yK/kTxP8N7Tv+pqllQqJJLMmUdXsheozFM7ZLCGpHo742Kze98IDe/f816t4AfHwdSBE8ASHVpF5ICTEbLXFPJiT1J2+amZJhHQzOf3w+IhmNwOFQgamCUU+NVNq1U+nRD7d8cH+/fhFraQlbJUdWGtP5er80cI4KS2LBoKLY/MZZXyGrbAkh9R/Gmo+yLV6n5/S1H/v4Yq2KEIBP7wxkpaJUNTa48DJE1iH8YeeYTvI+gCDgroUNiSaTEG3Y/4pXrwA0geXcsZMUwMkLGWXvsm8Y0W7Eea5dbbEOCg/1O/+H4yty73/UOvgjiojqmZILhIMk2Qge5fWKvYSTpaUav/tgkyScxm+CA6aSAYQezysPdIaYRdPPxz2D9Febx1NMnqe8baYUXIW9gne/mUPqAZmhvqyRZeSi/f1aCff6nzG+Wz10jH/kpkU0GLndDuG2yUeBizQomYmYbL6j+41Sj0SgoGg1NkUbrflkQGrvMo48ETOn8HqfYcTtcD7CwwpY5RXXpb+Uu5/w7OxvivqGu/AzUdEbsLUz5yZcJ+HEi+kuvo1DdCHT1vdrGnX5kAHHKPI50zcINxYwtLiZokPAKlvoLbavKdGx5InXfHulvryNaE3e9UpA= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TMZwkXUV+5ZTygwwo7D464fbE+uzs6T0ZbqkMTzgcuaetjLg8T7n1yLyPYzGg/8PHh3miC3eWl1Wb5FkJij9eNwH3dEew1yPzl7BzWkjOKa2g7CkkicYseSWHoye0g08JokajMmJCZ3LaoYBCvdLeHF3IYeEVbhUzBM1/pnbgISY5v2iKR9JdcB9mblrQWnuJThb6Z/BHo2V0CycLf3J6gvxsIQ9lD3Fwj3ZyhyZOecG8JRNxGRDH44Z4a73mnsJbCyCGNDbaxepGDmwNYd5S5BgX5Lb8goLFx99yG5Nxjgi0sS6Ho1Oa8Vz4KwFw+vrHLBUcdggH6O6raACobhwS6ep4r3HQXBwX1v8lwifn7GS/js/MwqBsDFYpEzQTpCax+WgxK+JSYIa4FfMR9YZRwPK8+/K7ayMR4uW7iAQ8ifbWViWw1kwCOchCqsEhwtUtsFNMCckrnia3PiS+nNQdorJMkrUDof3DonhyIi0VGpeEHHdW3++iTvk6fy7chSqC8R5nb2nl8wCov6hEY9tUeCSeUup07lFB5dKAQwfI/sZVRsfHi5Jk0eI7BByIaBcWKw8Hv3c0GL9UrgAIfcuHjhf6qd970GzF3oCoVOcFWG9fkMU7WFx1Xg9GxlC5Qz70mTDAu79bmEVR9Iz8YKmH/6hqGbVxztm0124OAh5ctuh95RuM1fXQ1Rv2XGVo0FVkFzM3aNL+t/TvFLGEOdiDS5xCMhhkfGAP+HTidZaHIyrYE/sE5Z0kWXL2xl66ILZ+2UQx2bzkGb8rroAM5pcPzDSb0E5xtlHWpdxx49PysBiq7CCkjHEf6L9IY/S9f+VK+IoDNUUEzyAWj9F/Pd8H9LYzD5NelRHr5Liz389fU2NucedPaWFD1foRrE0JiesFV5Ke28a0hpLdSBTie8Hd/+yCeUKqKYVbuZ9kvXdAs8/+0rDLKbjbaBwAQD/HmJtEfKFTM9oJMd339FcNuPSEErgnvDZs3CBzN99Py6qMfKrZiiT7M3Y0Pfb2yNq9IU0lma9Vw7q2X2mZzygPCWLyMroy1C/FslkADhOCtsYHpSwIrj7gsPLvxwlkwK8J8XtiVUsW6vQb6AhBoZrXRaiFx+75grB5Rwq42N0Ym5myhT5x1Uk2jl2qjd/Eph1fT5ToyCDBCBrtDHWlrIzYb52Pj+Tfh4YqZgLu3N3O5+B2HXywsyVWeMQFnrzIHG9GNqcQC8Y//LaVZQuyhv/R3CWBj5J4s/04Xr8b/WqYMyNVWfp7sxh+9sRWp6qfbCL6vHCWqL13GQrIwHyLkWE5P9NVSN8D9UqqPv3ck7oFhLeT/JkEVMUCpov5NH7RwnPa+u4VCfxMjQ5/Br1I2rwEFc7wnajp8L5y7TFqmy+daxnJo+uxaciouo1DYJfTgxDIirEOV/M36Z/WWuEZv9kiKnT0Xx1g/Eohww6TII62idzCS4OIASa8yiOfYHO2ElfkSRBGssLMEwIsXu+FoP9ElOTHCVEyN9t8Jpy06dZfL+/a7ed58lH2feBC2DUUgj9aaYzKCJkhXvQAfdAZ8OqAltpu2QCoBkY8qll/qMblcRd3eoH1DOyAc7jv38YtnT1/V1xC1A+7DMojOO+KeJ+5+/Ogg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7449c7ad-c424-4f35-8261-08da75cb2aee X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:08.6681 (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: L1xiS0Z2NiaBRZYa+SGqyG2zdcCDQKNZnaRC/ctnZYaFqtcfbpjahUO1LOfhf4TRYmQusiIprvNMtHXFR3TJF3URJ++Sv3kutb6G5Fg6Nbw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-GUID: fEcIJn1L6Lt9psMwN4YR4F1Vp8sBqwI2 X-Proofpoint-ORIG-GUID: fEcIJn1L6Lt9psMwN4YR4F1Vp8sBqwI2 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. Signed-off-by: Mike Christie Acked-by: Paolo Bonzini Acked-by: Michael S. Tsirkin --- 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 Thu Aug 4 03:40:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596020 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 05322C00144 for ; Thu, 4 Aug 2022 03:41:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237407AbiHDDlp (ORCPT ); Wed, 3 Aug 2022 23:41:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237168AbiHDDlV (ORCPT ); Wed, 3 Aug 2022 23:41:21 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2684B4D176 for ; Wed, 3 Aug 2022 20:41:21 -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 2741iIKU017622; Thu, 4 Aug 2022 03:41:13 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=JKqO1n16VKH7YKx/wwV5AEU/dxTol50UCjRObIePMw8=; b=c8eOiHEzVuP2TIZR48k6QlKfCf42Hlyu999B6ejgsesHrm9tM2DDDqMo9CP4Zm5J9eLj DsdcjL9bendvkW1/BjC/ouEvoIkhUGE8Pdz8Wzet8Et5lBImKODW6dFwP86DfHSIGWfG gM5dQ57WhsqDDaUjF2DNT9PjnpHuUECh4YnTMSnqDTRsDi8i1w+EYERBvuMAyO++jFBQ 3wY/zIExVMl2o9Vl5idRg85jeG7WDCQJoa6smKh8XOcDZb0jge8fsSqAAMVWpZDtWT/L krEKEJTADSpO2FjyR77B0yoa4N/ZazlC4iu3oGMBCGCWznpmFptW0QRJBbPwyqZBay8F uQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmvh9ucvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:12 +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 2741TSSi002997; Thu, 4 Aug 2022 03:41:11 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33w4xj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I2JxP87c58903ntSln5hstmdfMTNcQEcZkkYI2jRYBZCs21Fz4mQIH53ccrHfn8t0Gb9VoKtszCF5ERrgyeGmbL+4Pg7Rae0d13mA3G07MGGEnJrDC1qB8OIzoz7NgovIDqUGHwGsKz0V2mLSi2QeYeQeCyLisJHGO8U2oiPTgtI/YRFIuhLREYb9sECnVM61q7X24mKvzakDppHkOitCIoIOYWajKewLFuAf816wWQ4JyTNyVK1FU0bhEIYb2Neiewgd8Lue3ZebTFVD9csw54ASH/lvAY9939qukZgk41CtIsn/9N/ndoN/Cngx9YNJPp89gWETu7M05apysZ18g== 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=JKqO1n16VKH7YKx/wwV5AEU/dxTol50UCjRObIePMw8=; b=YpSK/M/Zdyh/keyRdhv9E9brqS3Sl7w8CeZO0K1LJf12TeE0pHPRzbEA2yPEC+r9m5JzgPvbWtRaF36op5/69tp7pWt73fZ1TFKsqSAeWOwggOKlL/MLb0racdlUKFeLxwCWvN3va9fH0S8O7MIHeXoCHh/vbky6f2MVArF3uj/z3G/4X9B+Xh1pYqpf4Kn8NuK1qvggwuNoa3za5bD99MyPD7P82Zn0WBniI5PfgXbgnNEjoOky0gmtnZKDDgbebrFsMZINDAwLokvggNK4jV4Zb0ZbKnQLKhyaS78wEc+5nQPVlgQu8qGQ2Hfs98bpHT0Riw0Jp9uqmz/H0c/gxg== 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=JKqO1n16VKH7YKx/wwV5AEU/dxTol50UCjRObIePMw8=; b=bBUSSiqqWqnYFq7xThNgHFRfWO9Yk5qfNe+x74LBQksNUpmvEpL53mAA8ZIcKjq+jNaduJ1DpJu6ZBA4AVvm10W+CS7mhxj9ODHPKr8tCFolYGOHXu9WQuVbkO9EmcybDH9vY698snvSnot0RX6gByKcn3YMhye1oqp4jyPWRQQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:10 +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.014; Thu, 4 Aug 2022 03:41:10 +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, manoj@linux.ibm.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 05/10] scsi: virtio_scsi: Drop DID_NEXUS_FAILURE use. Date: Wed, 3 Aug 2022 22:40:55 -0500 Message-Id: <20220804034100.121125-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0221.namprd03.prod.outlook.com (2603:10b6:610:e7::16) 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: f0a9783e-1dc2-43df-6174-08da75cb2bb4 X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fgavgBHZXkoEUdPfh3ZA72KDR6LeE2/ZynDZGJed/FpSNpEOFIT17WoJbrce5oDI3yee8bUadW9mGNsvkMekcbILQ9N1ODychNO2Iau6uSpL/2H4HE1JYjwhEHVfADnKWUBSnpOS/XdyRK9ewUXEEjTpxxFWjIe++WYM2S4Zoqh9Bu43VCQD8mUDRBkU3xRCdMTOPG302KihUIsXT3VS0+Zr0Lf9FxdIihPFhpuPLFWb2Kz4YiWRJ/vLAXxGKtRQVcPJVYCT6VZUEt3r8xP1uSJ9DR0XlIHuXGVKDHJf7pP3u8KGk3yQ/CwYJ7kE32HzF/xO0wjQ1usH9DYaIa1HDZJRLVTeCVkpplCBhjMPtjRQ0KhmZ+sTz1fenPnGliCWcsKMnGLvPk5znQ0kPWNZPZPcVIaXxo4VDrvZObKgD9/Ww1WnCdaIgvqSC5wRymF0ZSVgcmUfhohMhnuWCZ3ydRunAxmND/rhMAQ1QnTKsVzt2nX8/G1XLJTEK753gpqxC8gp9/FY0X5t4/MbTXJl8SY3Y6R/q7JSUXacgCYfUbfSm2KObA98YS4FnIftNhHQnG6rzK7iniQyRBs6qUaSFxtPTMiu5ctXWyzik2Za0+VIMwtyO/uf2LOOeN84Kk1rSDliAHTGsU09vHj7yIz6Gl5eKv5+9xKBH4QD+cPkTkZuiqbcuH5PcvmH6TeP5jhw5dMguJBq1toHKPo9wj7M2J2YQ/n9ZpWRubBMb/cLqMtHjxXuEoWBRw89ZqdHMdtrUUZBJ6KfE+/xaV0ItaadDK2JCSUBZenI+GN8Qs5nPFM= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: x5mtVmHmLCzHaUxUjHD5MentUZq4Ei62Htx8O6UGnNbCmE8ye0Rp0kq5rvCen34TmssQ9ldQpqivu4wzXyvDC6Bw3J8jYSHBfNyuoDOV1EvxgRzXBQ0Qk43eYKdGmUvNGM+vEd7fm7p9ZElfSggms82QRZ0Htk3dXj72GZ6RnFobCQ6UH6jN25a3ED3BNs/tlwIczkRlfdt+23jdKs231XMt99MLES3dsymmD+KgXJuXc86VFnaApaqfY/JkU+RuFFmvcrDCKhrErj3vW5tib11e1hYA6zfFLKAfaFo1lUG0O9gfS7zlQCvHKYRgVV2RlvM0rPBIder9MD582hL3e3ObnOqB3ms4mY/f9CB0+Y4+DvifXVqfmXMliUTy5rvn9vy7hrq8LJO3yxomjwR3nB9mV36mcdJIjrDIWzT25Axn1jeprFNTUIpwIWZDNJpkGG8gwwQK9ziNwnKqhd/Phhenrq7bhW/82fHWg8I0oCkImJw/0pcYLSpdVhcHqG2f/bgECCCyf/LhgIUBd0PVsGSMAI1NkBrKqx9horgwDOCOokrAp8mfPEaR5ShAPPpnEgOcYK2C2dIdrsHh+M1RHUDuBAdB8HtvMy5JzoCNRK/RdAr1bwiqwXDGhR/iUe0EelAa+41ueSP2S8hc8ZaWQHqj9wkblKlo27FAze3gfBffoWvbl8HOdp5nkeB28ZoxR20RyRjbMTKSvaXYZcGHxwArTQgwTua9AA5Zs1lgWwe+kqA2r9l8dk46mhe/83XZbb3A6/1qAoNCEn0gfbsKbtg5qg2vjji7OVZ4R8Ekla1OHGbsR9DX55PbRxLhvOBHOBLZ4fe5/36aMy+VPb8J/rljK9aeDAezYNr12JJFGIWznjWtdp2QFNrP6H9hwZMg3TzGCK6oXDt6fPzOvqbbvM0ehLdzpHtfSvzP1rvFkOlsP58S7V/PNkMfJPzlTtBdQZ577UTi9RpjJp0v3fBRHayfKpzhGUgG3fmX07Wxnt/w4wBvKrn/16uEKJeH9c0BQqK65iCeFdR87uSxEir+G6OUCoYML7Iqv9HhFe2HBIUdXroIWRQZuXLj0zXaOQC+7IVgMtKvngmYCeG5Njg7qd9mdWghAfDQ40plBxpflPPa6MNWtDHOiJARdODA8J0L2Ga0r4TTEU3dJXIgA1kKBBqfy6zfZ8UCfEWY2kTAe7B+1cZP3pdTvZlrDLZDGhJd+ONwaK9kj1NKGVPZKf2V5RDOI0cBjKPGm9gWuLkPT1tiwm5G57Ugo5ZGA8drWWHoMc3IvKCHKqZYmiKu0W4lFu6MqUMN8MnBzW+nvB4hzegpkK6On+ZYQ59rSrWK+b96jIBkShmWibAiHNB53EjTZid9YzHuLM1ZYvoEqgl8cpiE1qME2yPcv7eRMPS60x6J76vT9WNyDfmItv0veML+xN/cX97XevZJrPgsvuaLvo+hwuumEZDbZTxqNAZxc2nQD+lOV7eR+ndmsLdSgqUiZ5DG6QDSdCDkhxhIIoDzOqr2L7ieZmi/CYRshRvl6tKGZBbxm5ssqe6UFpKAad2dVVR0k7+eyK+zSU1hDzPv3u90l4MlpQ7QtfpijhiQ58GZ0cQz2v5ENbGYHrbSY245nQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0a9783e-1dc2-43df-6174-08da75cb2bb4 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:09.9180 (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: gstssQY+37sniUzgoKcNwAfjR1ku9PxxejhjI83pNlqte1FRMG2nFXmCOtx835CVsJrd+tORrSpsUcjs2LzFAwDgefsQ4JOiAb/bl+E48IU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-ORIG-GUID: 9L0fE3rUpcrMBmK_O2giFiHjZ7m74eDV X-Proofpoint-GUID: 9L0fE3rUpcrMBmK_O2giFiHjZ7m74eDV 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. Signed-off-by: Mike Christie Acked-by: Michael S. Tsirkin --- 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 Thu Aug 4 03:40:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596019 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 6DBEDC00144 for ; Thu, 4 Aug 2022 03:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237667AbiHDDlv (ORCPT ); Wed, 3 Aug 2022 23:41:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237252AbiHDDlX (ORCPT ); Wed, 3 Aug 2022 23:41:23 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 186C13FA01 for ; Wed, 3 Aug 2022 20:41:22 -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 2741i841011148; Thu, 4 Aug 2022 03:41:14 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=TjRaEpSfj0LgRSoqfMkL64I7FvrMSt0c7IHdn0Bv5lM=; b=atGyyOg7TmN25ZRpCKEVunvg/5ECWzWIsHWF9ttWrNok6A3s8rf5g6rSJEyx7lTB/jcy 1qytvQc+hp2eLFgBF/2co4Dsmcw/WrAy5HXo80e5qgBz351kE8oMrGXxog5bfOhIXEho wyKTsf/ROBjRmW6lmId/e9cnDXCwci/x4BgVOmAPN94cQv7O1rXGTxnwKLTrGsxz4RQ0 x3FqjPH8Rn1l7emV4I0Qq4bfuYv8KgWshfZ9eWDRdtMljilDFVzwGyf6XeTwPRpfwOWd I+2n6/6fiPr6OW5fShRP67JN2hHx+Rp1vOq1SeNM2RPOQHXQfCf367DHuH6S9u7TiLCc /A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmw6tkpwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:14 +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 27434jEP010909; Thu, 4 Aug 2022 03:41:13 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2106.outbound.protection.outlook.com [104.47.70.106]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33u06w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PoUIeRZTpl9XwgSIEZ4+aLqDCaIlLk91CB0MCROCI1mIqKrYtThDlluiyINojSLLIBwtT5I22NnXQeg0GfuVkBYMgN8EJnCGtI1C5o+RAaEq8FY7aofb2CGcPhY5aTwjI/2vSBD+gH2QqYBZrHqA7uXJL9/cGtI+34Z8bRjC/EjKvHa+B8sL3/yH2gx8/DvTG46UvluMiR7lyZ+2LHuJ8ZHCmh9aFHejYjbGhkP+KHi9AzNncp3uxELTvX9SmRlyquHZrzgD/n5Oie6ZX452nifpfYMUJMrukqohKGzHhDiL4Opcsj5xJEw8P2PM8TfSk2U37rA+JbdNV7sCFPusCA== 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=TjRaEpSfj0LgRSoqfMkL64I7FvrMSt0c7IHdn0Bv5lM=; b=F0+4JsT+hTgHgfn93nCtgz5ei3qC4fsp3flki3SShf2L3mh8+fGaRHqYFuuLwyEs1M4dHsxUEs483v5yPPWi71e0nHHlK9HjntvEb6CI9JZrVL3CyJ1ZqPz7dWJF4Ez1RIK7FzAsgQd5zX/0HkYtXh9BqZX9CD1ZMXtHIWw8Mc9rk1BM6YXZMJpHV3yC9suAxWol1AGfbNSJ7iNxkZP641WE4YD4h+v2dvC9vh7tKBmn2JT6VlwVjdw+gjkdCb6cos9OczROnC/I22yLrTHug3CfgjugNM0u0dVZGeyDoqseAMDBItTIb0hf05DgJXGk0xumWH9xp5m3o6HZAOUr+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=TjRaEpSfj0LgRSoqfMkL64I7FvrMSt0c7IHdn0Bv5lM=; b=wWSpBNxl+bvpTW5z+7juD9uTWdq1CZefqSPD5XP2PimAtEy9c2Q7NFEwfOXBHskgIIUNrUeL6n9Hby0daTlhz5Wmpv49QwBOGIBiuy2R/sFrvDbKxRU99qNnYwp6wq7CXf4n/q8zLQ8n5jQPePta3SqwUP5YTxRk6+53eLOL4/c= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:11 +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.014; Thu, 4 Aug 2022 03:41:11 +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, manoj@linux.ibm.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 06/10] scsi: qla2xxx: Drop DID_TARGET_FAILURE use. Date: Wed, 3 Aug 2022 22:40:56 -0500 Message-Id: <20220804034100.121125-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0219.namprd03.prod.outlook.com (2603:10b6:610:e7::14) 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: 068961b5-9b2d-446a-52fc-08da75cb2c8d X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HXB0negHhdpxHYbG8dZKwnKRFDynOcUcb0B66Caq8HAeee1TgHu7gmJ5wtEh3DbGPw3GE59WBn1lmzPuFO6AzFBgEOBI44gdLGIry1Pr3hCApRLTvv8UF9P2zBIcEr1LPgrcBP+Cu5hSCqno6LW0bB8sQW9jMPdrnfDzvAGJDbkZWL6O6fN+X+fPKidjBdOBLUreslT9g1zChLeRul6VUihJVUmhTL73e8SSneZnFmdLxdvJxs04L6oXTu3Oky1lDMjsWpHqxHOkHPUg7aL0fHZoHIEMRZM0ZwXPq+01uZskWpqe5l35AFt+6UhkwvqERZB/MYkVz+yaaF1m4TJoSF1V/mKfpUTYzXlykmC+hzlx0bOoyHL0D/KaRy2kw1ml8mBD5l9hvyAdkcS/VC5kuU2kSeyCjbGUe4ITsHSOgV2FzvPX8D//1ZjpKQpdYlUAuSucmVM9ldaW2HggLyG+TIbO1VYgMFxrMEVCaA+PhU3j/iCUPnhETfjHgpGe69xrmp48z39+mY2ivk7+7SBotyblmTnnqnun4CXsnznPx9GYqRrVkCvW/cpH/MVWsUIngC41zeilK5B8s0VfmoC2VoFH6Y5lVmZ5xvNQC6AwDPpzk212AfBaeCjcNa8js0R27a7CyEOKzbxyo8n0C6XxXh8rK6fjxQi5u3zZdOx93QbFzdQVE4Web+Twnr6gmaiUqVDe4/xMUJKzffu15x1fPR3PdBDRXk5eJSRGhoPWM/f29/JMclilwMeyqI4BHCRFj/wge5KVsn2aEKQj23X8GTMg2UmSqrvzRG7yKFYjuxw= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YDewcz3Jlfao/Pa2ON8EaYa8diN35Lsdar4uicb6YNxXT7fmo0SxGvEprhxdQrxvX2wOCAg+QKzTCEq8BCCCF5tBiO6y3FncTwjutqTBVPlCziiWjGLtrqFVqlHgOvMwc5lB7HvJR/WlI3HhyyiqP+gKKZMVuKbIT5HJzusc3070hzEOTdI6oBMKFwE2Xbr2qmyIHsN7Wh3HUGBM4msb0oiqkjuZMxMaGrKcrOOOSh8qKKvzhu58BdU8124ayVOu2hXycu41XhOe3EN+9kEQiUaawgkClFOnUDB8K+pcucmnNeUSEnOwOD2+F8cia43lHHbSZ8+1Oym/fDrtsepw7EwD3MoD3hmLA10UkBY/0cSt+oKXOuK1c3SvFS1EYtREW0wODDg9EO+UDcsgBz9iPipvmCkoNKKQsTekVcKC2h7Qp5drpUY6RGNb5/Oej7j+Cw3tvcovVVpoZpaQNGyIIo1LDNhpR71zBV1Lel6TrJ8VymRycrOJGwixbpX2V7EPe6K8ouPbShgO2Ma4lKZ9Qt9MVYGv0ABj69Pk9RmjDfLvq0xRsbdGdYPV5YwBaLd3+TIvjJez6pb+aoyxMgsgNFQFO/+Eb0OCn4c2YffnI+uiRi7IyDbz43oc9tt3kuZyIErAbmICOSOlRO8B4iUAUIX0BxpZO9wlXN7s8OFxCL7izK3ZsAu2bs3dXg3+42XvgVsw8W4ZoHk2DWrKJ5AaE0Sl1iCd0rU0cmhSL0eGOOnMCUU66u2UnJabAZ1q2kaFPwaWHXyUhDnJDp3ns2drSKK1J9RFC0pg+Bw2H+AMRS7m2pUfT7WpUHER1yCAEaffFQzUWRiM76cJobuI6A1ZqhNKTIOBBUoRgm3rGzldpq6l277xEzQ7MU18wsju9AKCIk8clryLrwX1k+JYqkiL0uNZtcReH1MKpWt6hGalW9MjiwJKcdVpDWYy+v83vqPBUzcis+KpUALoELom9nRrGH+4yXBasKS8ga9z0lfHkuzhE0Td1PtHjdHcs0XuAWhBWC5SoRP2VcTtMSrUvSyoXuBX4Jl99OyDWPp7YsRehRD/p1GhXBIfPL9zSf2Ql/Y1KO1rgVpzRX83KN0NvUL4BqlCSeindhVF6soyIuzoTpLy7zeebDKfWKVYSJa4hd3WtzFMfd6ARDTv/GmWeYtcL6cxx1CmWCdQYNTVfMaLXauVNFXBfTt7N7K6v20yoQwH8IclGny5oE/qZuOp9K0jejhTVG4kHAj9R0pZXBZZFjNJKshS9j2GcrE3sJPwic3kjGkSWcr8l22NBXag6d5Cvrgdifdka1akFp9pROHMtpVjnQxrIqmv9QrvfiJbkrf5oWreLDxoQq0dHQUHTmCx8ZbggqQles6Zflv2Fk/6TV2wbi6ynkUlBjISac2oAH8fLl58ZMXKhBREABFHgOgMUYso5lEwU9uOVuT0JqkT4i43S0IzvGm2/mAF8parzwRl8ToLwktBdiQFXU189+6AIwbQ/6HGCz/8RXWfuV5a1KUALe8gyc92HZg9db1HvhtFo+n4nuzlmEATrkcnsfL8+f3O+MVOAvVCZBWYgQWQoeBnAfYa7gqDigqcjIJjLT2MKrVjhOrrvFKx6xA69ZGUTw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 068961b5-9b2d-446a-52fc-08da75cb2c8d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:11.3866 (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: c1llDYgazXMx9Rdwmd+6GPV2aNk1wCWgISa+RR1S9e50nSo3E8vdW45AcGwu7iaGh5lYGQv5loyQKU9JiCOqJWErNxKyQlMLB8YqlWofbTg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-GUID: SbBY6EOkrZcbAKKrHDK1Fw3e_p-kq8wq X-Proofpoint-ORIG-GUID: SbBY6EOkrZcbAKKrHDK1Fw3e_p-kq8wq 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 --- 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 Thu Aug 4 03:40:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 595448 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 E5679C00144 for ; Thu, 4 Aug 2022 03:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237391AbiHDDlr (ORCPT ); Wed, 3 Aug 2022 23:41:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237257AbiHDDlX (ORCPT ); Wed, 3 Aug 2022 23:41:23 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D9FA40BE2 for ; Wed, 3 Aug 2022 20:41:22 -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 2741iGBt017412; Thu, 4 Aug 2022 03:41:15 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=nt21gt5cMTM/0MqyOyZIh2gV5kGoCeRC92v8sn88wHA=; b=g3DxaOgPBQEFXR87MAnSZtQsX9yVpeNPrOm7S7jNx59ujNd923a5KVGUAoVYG2mv24xw jHD3NO02JcWm90ek4sZ+CQC6uzPZ16HQeBbWla/ybr7sr/bk/gOvmhmB27YF6lROfmHW zzEn31D4iK1SFAIy1UXfKKsmJ9f1CGcmnMs5hE/kRvkJs3IJjSgQoGPvkHoPuQaMTUK9 tOs1emT9Rf79j7T5X0k2GaZMq8O9jbQZInoiNFHSUo9XaNHS+J1CXLUGAgzmiOaF32/a 0WP/UJTOy0Hqmk8EzwBmNbkvQWTRYIeD7/Df7t4l5UiCOp7vZ1qkSs7ZVDfSlgeSTFQE mg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmvh9ucvp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:14 +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 27434jEQ010909; Thu, 4 Aug 2022 03:41:14 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2106.outbound.protection.outlook.com [104.47.70.106]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33u06w-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AGl/j6JsJ4y9BtQFXpCzqIkocE0d+uJEBEF6uuG25BQKTGI80G61xE/7t9hnDz8DyXt5rBjSeKaGGUwzAnhjjNrbMTyLDH/HPTSMBzXfQOBwNJmLXr/DZyc2I+euaBVT1sN27fNcgROWlleUrOVdF8g3zZOYlQ352TcNAKxUew6Ivdz8aog0r01zeYlkzRiO8enzmydr/8Uqa3b4FIPpiAZN30+KbiZyqnBTrSpX3By5zq6UuZhpl0+ooXWkKMLKEElYGa48GfchCWPnqDJ2Cl2nmgmq3imfb5qgjLoBaujJ94NmrpBr6XdhrUjsjA9AXnj1W74mNPv6x6UNopofvA== 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=nt21gt5cMTM/0MqyOyZIh2gV5kGoCeRC92v8sn88wHA=; b=LNSXq8fXFLnPu53crYzKL01BZL983N4NqEVkd8r1moquLfkL6jJQVdpM2AAyNPW/zQ76y9Vpmnp4fm4nhaWrWKGenKYN96FzrgEhbYmdPRwb/qE2GXGjPtfy4umGLaDBPXIfPPNOeYwvaPrUh+XANI1h2+pEAXllTAkIybCnzmerSs0r/ErLozj8y4Zg7Lwu1nvZMSahq2KXeYeQ56mi1vxpcaq6rEIRXhi7T2GTrMP9Ux/Vhs4HF1PE8Y8QiFvW6Jbm9Kfht2j+KaRUV6hgFmQ7aqL3romDV88Z/7MExRWuULgmhm02DyScdGhIVfUQuhBucMhqNO0t6L805Dgm6w== 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=nt21gt5cMTM/0MqyOyZIh2gV5kGoCeRC92v8sn88wHA=; b=WvC5NL/xapyrpmN9uiVR5Y6QlCpPUmWLj5GtwTNNOWDqLr7CRFm8m8AwRcyHN0BmgaBXBU4t2qc/RiD6rPikVqzHJBCFDS3q/6xXF2stIbuJ0BKODSVFErdnMLqHoYuuYvgHLwrEz7kOIY2+JPMgy8EfYnICNfWuV29C+epCHAQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:12 +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.014; Thu, 4 Aug 2022 03:41:12 +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, manoj@linux.ibm.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 07/10] scsi: cxlflash: Drop DID_ALLOC_FAILURE use. Date: Wed, 3 Aug 2022 22:40:57 -0500 Message-Id: <20220804034100.121125-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0212.namprd03.prod.outlook.com (2603:10b6:610:e7::7) 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: e2c1f88c-0700-4580-5900-08da75cb2d5a X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0eTkOmk6tJWXixM0SZ/hG5/rRIbfGXd4LBkkR83IODjZIunQL69tkGoeAUIQU9dx0gqCM8XPXvMOz2c7VC+J5rVE2Oo6Kg411VE9Fj6NRx8Ed4H8S79erdMUgDP+kGfpnQDdkV+LcLzcPyqu3hfHclZ3eueVYHxgqmgeAlOCztkGKMokp50OAftEMo+Ge4KvqhS7SZWq1mEgHc8r5EUBlfRYtHbMvmnrMoAK7rucYmSLzZMeNoaHJ7Ltf4B2l9APNg3mQNIcjhHXyafH4k8zNpiBl4ySzouWpkDmaXTtHN6JGv1h3Tky6/kidGSAhPWw483nGwKKZUFEpcjQkyr+MW5LBvw90WinPxjEgFSscjRhTwHr7P5zbRLY+00hHRUtBrxfMvFhqK9h4p/cpzXEW6TPLGYDsPwEcYhZNy7CBAJNEuH7EUtPr+RYSZJkvEfa6QmoxMTtgj0zjBfDMwNDlRR2nXyv6mcoJz9VY8i2fdPkMl2JWpxXBxTLuri7puqJGC7c1dpzTgw/1siTaTmKQ0//JtBTmF/kH45kDIE7JMbcWFG+lQqVuvWFzQG8WayPo6WLkCB8mK7hoFPsZ5tOcLfvbzE8MLwZX6aSGlo7x7ug0+d2wYOYJEQR8Nx841ynkkx6v8Of+GEUtyOMgKJUuHekF6NDjJG8dr5NfV7YhvNcYdVelluzRp9w5Ew7DduBoojyH5ZeZbk0gSWjwr/PQ1dPANycjm65Rhu0H/pp61zLoAKgpJ9UzlLiIdLUFda40RjQktPQ9p2jHOfDS/m0yEsIjpaQjbtU8/aSGC75Cj0= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uncndggV2ILWFrMO0etE3ka1dwqXVFaqZIvXnyDMdIRWf2Oi1aY46q8ZyXO9ocISyc1hi/E4Mk1uqjRdzWvX9Ss6CbIGvSv29DG17IXrl2uXOALibLTma/NV+YmQ82HJ1v7cQMHoTl/qpKpyCXwwotG6QYoNHSEgu6Rd7VqpNbxElGckAUdQwHdTffrTH/Cp2x7OOBuRpCy2wiHcdSWiMkJg85u+p0HMaXVFBjtBS+SsptJ5+26lJhNyFn0mb5OHPpTPhj4Rl9YFZdzdQ4MEjENj3LqkHiaJfMfANPI01SCfsPrqmx2KTQhRZZzE6ivjNpg6ZarVq9ECH7BwfAiCyfY22ilghMhHe7T9m3W7dVbPWFMc561I6S+tszleih8pYlcrQlK85fslJxMcprZzo1dD0yiXY71RuGEFVWIinveLwbxutbbGDPL/mbuE7Hu5Ou1WInfsIwYi+DCSyI32r6oN/HvxwHqIIwivLG6E7XtuH4ySNE0zI7sgzwoqKXUcdGoJD8vPO9nMf2pxlLeBjmYVqXoDAoP35fMaGCb8FlkzQQzW7uHH7sgtGUF9ENfZzp6FaWnYesj2guKkpIA6lFgiQ/bXGrcT2mp96u0AepRsPnsHpnZI+9X49OgM473zMmxY4QD6RLGw4qkddg2EFU3xiXWTZvtOgTlPd+R2RkqSks1mcRUexYHAt0YVqJmFib3KAlN/wGvDVwt+a1ISE+LiCRsbokk8WE0IRHr7blNr2Vfp65rIcZT5fq5qmaHq8TLlGtuxEwFOhjQJs7loJGUWmknpe7xDVLjkSzh3rUjTtoxE1ySsgZHtl21rOgIelXGpJeMaDVw/MeMnwJOuqH8r93D6DeSvbgGoxoQtn7Z0XptH1FxAIjXfv47BPxTpeVuese9WB5g4SBM93GawYgnk+AGR0m458F1bIJeOfv1t91eZXye+3U1DMwQPjucE4AcsggG3jEA2VWKhm7LSuAIdVB7sIQysDfWMXrRV+agG4xDCZdmsA7B152QEc8/+8SgTQdpZCUurr/KGXDS+gWRXgGMrGaJLijdGgCe2f+6JYKwIIp6hEd1Vl5iV2D5lubOf1psF1bKKw2RvSY6/tDA0f3xs/ipmUmltJv5sbMKraHPW0bfDkeASjBdAVV36gT6qUf6Jyy6z5LVBUFTsgJYver8AWJMrZuwgzHE2eQy0CTDYTJ4prSiLLvCtNyTh+xO+0rWOWz35J+Yv2VxGHpKfRg/RF66St7xp55KkhVzEywa39wPaNRlvUEPJxUn/SxWXhleO9TRlbIMxdBjn8djr7kf9dSBblpjtH1ivieF+0BT1LZrpHAViD1x5ein7dab4xLPyQ3n6tXbUXG/1OK62I6cso3x0XIXmmapdnv5XwXxim93xfu4BTaRlGOn4NQj3vtK0wfTnvNgUCwGf+9QpbiARFLsWT7EeIx524y+CCMI4QGhEnmwrSXC5ztvnf8zA32hjPdOtTDf9HwLFy66jD+WZCE5j7U+0L3AvJqGgs0v3n2F7usWWEgbbwNXVxMnp+RdWA+/LPwGUCPzAetENSwtbK1ZBAj8XiSuKtv+hzYl25hf79n0ihYeyCtRoyvb6ugMEG3JT5wFsiRDQ8g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2c1f88c-0700-4580-5900-08da75cb2d5a X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:12.7303 (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: mgv4kq5X1AfWDQZQO5EGxLbWpoFhj+/0xXLRwR27qAVR3fGbde+J6BBDxWIbCCa03ELn7sMd6RU2ydycZ5ZSGUB+nfiqmponV5VxxaQ1UvQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-ORIG-GUID: c2QgWaPrlnW3m-nVCNKMnunoB-xdAFIt X-Proofpoint-GUID: c2QgWaPrlnW3m-nVCNKMnunoB-xdAFIt 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 Thu Aug 4 03:40:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 595447 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 4E8CFC00144 for ; Thu, 4 Aug 2022 03:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238383AbiHDDlz (ORCPT ); Wed, 3 Aug 2022 23:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237313AbiHDDlk (ORCPT ); Wed, 3 Aug 2022 23:41:40 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA93D5E32B for ; Wed, 3 Aug 2022 20:41:26 -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 2741iE9M016167; Thu, 4 Aug 2022 03:41:17 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=1f8YiS0IHoRRtVmR1UbpvXATYaGv660LunomVT9647g=; b=PbVTcZF8hGb8v2MFFTUlI9RcO0hMdFGqPnhSRb6UnzuY/19x6mm6t5ZCmHqD9gn9kOIT 00Gwr0NBiJ8k3B4TBMSKcdasd4lfKGGH9ZZLD4VMOUsu7wkRM83bJUFLBIHO7wmbbt7V 7/1FNF36iN4068vIKckYiWmwAOgfPP23vwLIHwzvXRonnTcWFUlUKETJVnak2vku711A eEn3OA90jxG80kvNkkb+N5/q2FVNdp6Ta6H81gsSvTu7i9FT/VrdLy52jW0vkIOkQ13G PgP2zHFkVArCf+RkNzEgb9SYacbKtvifP2Yki1LqQt6qjpXN8xhswC+b8EI3cr3+Qlqv QQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmu813nkk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:17 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 273MYThk031021; Thu, 4 Aug 2022 03:41:16 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33w896-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MC8lCJ+1WommQ4O9YNIJ0MXij0UKIhU00ypegkyrnM2H1rbXrKeJNdxunjZ+gw3HPUvD+DGInc2VgWBm8JmQl5nx3z0NR4aoc+ZPkE+0CvclO6Sar4uQ6h+++lp+AjfhiojEP0rleyM89lvt86hKrOwFgsateUdsLO6H9AXaIUIDNu1IES4s/zLb+jYVT7y8HAzt/zV4H/cvqRK4xn84WwRx4GxrWz/7BqwynGovMDkC1ZV1H0t+XQv5BOgxh3rlKXGQ494hBFDE3Q0q+fV4Om5x/+wLd7XUJsC5kwBB3qplprnTlSCAA+X2PE2D252w/70BMTNyLch9QhVNBKcx/Q== 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=1f8YiS0IHoRRtVmR1UbpvXATYaGv660LunomVT9647g=; b=FHF1u9hBkEVsM24zu3lGYqeW1UlQYcnii5bVmapmKNfjcCVUntpSlYMYBjvFQuMlp85lG2AYKtE7Z/yhPafn49sBKG06RKuLiZGLlGLjBf/svX4AEP8V42Li3IOR3r9gWNcsZXa7bUUL4MStLvET6QolZLnLGfkRAIaQasToKbMe75KkvAZ7IyPqwMqQjJV4E2GRpOCFzENunRuEqmGsfKt6cII6wDExdb7vEuTG0cynM2nM+v0ZxEBngIhzmkLz7NP5dqQULEzz9b9f+0Sjc5dyMuDcPhbR8uik3yQR36pKzZ1uccStS+cWG+l6HZJFSH8fil4XUmaHbjWjKt9Pog== 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=1f8YiS0IHoRRtVmR1UbpvXATYaGv660LunomVT9647g=; b=LibufsgLRFJSEVKhTIM8SpbtpMnTLYHHGu/13RUNQIeZ4pWmReG4kfBuXUHY8TZRHMC/wv/g/0kQRqv1vQk03B3yFj5DMRtoTBZsQ/2D4FP9BJuIPwaALYW32U6AyUMfUYIRhNvFOfqNPTQh4JYmQx37AHRotJIsTPrNvuC1C3Y= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:14 +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.014; Thu, 4 Aug 2022 03:41:14 +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, manoj@linux.ibm.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 08/10] scsi: Add error codes for internal scsi-ml use. Date: Wed, 3 Aug 2022 22:40:58 -0500 Message-Id: <20220804034100.121125-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0392.namprd03.prod.outlook.com (2603:10b6:610:11b::31) 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: b35a2ced-06e5-4c5e-aac2-08da75cb2e54 X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H0ynLu2cf+aO+0IjHr9b3SvkiYCvOyiZMZdHMuTdzXUmrL+wA08IWQpKo9D6vbeV8pTS7nU5uYCi0jRcMRfWIRAN/Y44dvsQ8q57n1jiZEyh9DBFcwv1cVA797T+qDV+Komh+hzqUg2rI9cw59NDuqlIag4HmCj7+T1UuKcjau2XUJRwIdKYZVgV1cpZKOy1pA9ZC72GTT44s2ckU30biBWmoYa+UcJnKVoLEj6ezucP09QhxArbGz9o+t7x4xVknAauD8AvlodUkqY+E91nLSIP1BvrlUmQeoXFlU8LVAPE3Ll4dfBcefF4gKln5iOz1oycMWMAbeg3pmxAK9rAG16KbdZvK0AnxlqubV1Lib32ZtImTF6sy7yMXr3Hl5Vf2JHc6e0BVSRsuPuNEOwqKDMby7vwAXgryqoDwXdLy8qpsckaAhq94nP1FeK9OhZtyj929G/erUp3fZBW/ZM+Yj9gtneO4dt/ZbK/IyV4UvDDPYLzt4HRkvC/+RNdUo9CVmc7w8y+Ml2U2MOpe8g9wYxVkvDEMks6jytmaJ0QVe8T21w9qNr945Aac6jRX9+0HVvyfu75pNDzR3F38fis0IBm6eW6iA9R28lxDcTIvKakCSF4/S1SIkoSroaVCvozdigs9kKdGGoAupMt8arAk/pxmF1t4GDYXevr55WVxV87hzkvfW7XU3XUuWeZamQy4b+70uK47fp0Z2u2ntQc5bSAh+uwG+rqp2mxubgVZ3EaklXVafusHWUh3j5+PbSZmE34TOvgHmsUfqSS+0sylV0xfJ+q/1QxiQ0DhPc7b6c= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fWwBKcgW1D2DL9zTcb/LMnUAqCiBL/f68O13KglPr72JXp1pwKf/oqr8AxDxwCFTKzD1DTwlJfAred3eWDYtJjx7jt53rmLRVjjv+8kThgqDdA1sPhTSzp7WtQ2MAoO42Awwp3tYXTTcQrlXMVLZaAufONo6IPdt9cUMDip5bbqPbx2zUYAMOIbnvfT0M1Nxv0970ig3YOr5ldwqyfwBUDx7ID5DrkuDiTkfpTwoQLFIrPX44UnQKgcK3QueGPIMJ0c8OMPRpNMxlAiKGcRxjOuJV5AbC8NUpqu5ydz6bJWnt4yQSJMyWwHsfbKtr6z3mtjwLL50wYgNL78sJJa1nqb9rTeLKqSEojlkiWU4P2N1hTTL3QlnahfULCbDEekG3ll/kxnw57JLjL9L0aCP5EhFfJbTzCkeMEzojAXchbmNLBL2jIXzA5P1Z4IUB6ZBL7792dMoqh4QQpDIFtpZMql7N8rQnA0NgzwBrzUnb0ZNSxqyVfkO+oahiXgAlLCtAtugKudzz0KP7n6HGLFjOtN+4UqSf9pIXwHmEw9Nw6CKBWoNBXLoF/CaVVlKyuyNghu1LU1qUncHdwUgFm4Z7zFuLE96O4BHS0ELYpESuBgAwtXO9M5VOG/d10VOZMu2mFaFz7JG0B2evooe8rAXAk8r6bYN79XPzd8E/fOWzBCDadPB44QBs3HqgOUoQTww78D6/SWXGMm7FH3wTtkzvj0bomDZr/Cak3Ns5zq7mAT7MahZANazTkc3+ERzWJP8dA7dsf3kHj8OBZ/Ss0mWlCGZ4P8O7R9hLQRQpU8tHKv62MgpQko8QnbsVz6z6GFst8d+1Qwt9A+wkgusU9Xv+GW3pvQrt9JLzoXIOP0gnzhtD1vttkFx/AfN7ThaORTeHT8biaAe0rwBK3JFvsZ13T1M/cM8r0MxY0ckjw7TwpMH/Am1mN414xQVvKWBN697UzXQVdCN2tOaoISr1Fum8s0U+pV/xZP0E+22Jpi34rg6YeC7omj2SdqIQVFlokNY/Es4wUypQ/5TGSiOnku+Ul4yqF/z/F9ND/5diIOcmQgNLtOmHgAQqzOBkG9Wbn9UNR+2W+FXRMbTtMJhCjr/tQwToZaL+FpP42WfH6iRUnyex0qYedadUEoWp5+Mox0LZVIdm/ckR7fVCY+PCAAuX6AszazjRPgw0h6RGOG9hk54d+JWU5seaXFrwhl5suVRrb10R5fgWQcJ/ik8xsfwtzDBoRxmim0V6ec9v5gu/N/7LQcAiDs+xs2/j1bSsn/+cDL3KRu6F2c82f1xDOWfW/cg1jeiTre6NrQxjgvcG4ckqVqTIHjN4yFARfzkNAh3KcUzYru9rJuXNQ/CUPEAOb47HoZrFdptzGx4yCTyE/5jS0DzYGkjnhbmKiQx2Hx4NSOdNUlSAdCBSbaZ8qphYkpf9iv5+wAwUxrdaAlgNPii7c4yAD0lTYuc6RuKYxogIBRxmgygu5VblJ80RLWL2uX+4CjVgRrO16h3c+osDrempbeQ/6yss0G7638fY17PNA6khzWi60ga8oHkUxLgIUhPzckzxzp/WnSSBaxmnzw+eCW4H+0iIUdZ9aVnTGQmUn6TJB8gndNpbD3lcDqvWw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b35a2ced-06e5-4c5e-aac2-08da75cb2e54 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:14.3395 (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: vdK55Vdqfevc1U4iS22hi5EC5nee4jz96ZWxuBvcfTvqiNVWhuTBGmp+jZxuhx11oFEMIdCJHIEZo+cIZVO4uJETgvZr9Aps1dqnGEwuFz0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-ORIG-GUID: NxoWHU85HzEzApnWyiW_Jnm7hk6CBIDh X-Proofpoint-GUID: NxoWHU85HzEzApnWyiW_Jnm7hk6CBIDh 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 947d98a0565f..4adadd3fb410 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 2aca0a838ca5..eaf4865a2cb6 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_SPACE_ALLOC: + 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 5c4786310a31..9d2d32bf0171 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_SPACE_ALLOC = 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 Thu Aug 4 03:40:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596018 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 53839C19F2D for ; Thu, 4 Aug 2022 03:42:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238384AbiHDDmB (ORCPT ); Wed, 3 Aug 2022 23:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237338AbiHDDlk (ORCPT ); Wed, 3 Aug 2022 23:41:40 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB0A5E33A for ; Wed, 3 Aug 2022 20:41:27 -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 2741iELP016168; Thu, 4 Aug 2022 03:41:19 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=RTmmg52yunYnZHHvRKyJCmSkaEhemyWsf4GOOhkXrbE=; b=ToIEmwXht4TZ9GD9IkUJ8SH4kHvTh0NJ+9E0AMDsOx51pCDU/aYzo5NxohloOTIbx5BE CpJ0NuIaTZWXzqi0MNcGRkZWxecHE0+YY+oNL+rnDUOfVMzy5OEzBSTsIElqSwhbOCNt dZuRP9el7d/pBauFqZfaN5wREPpGbIbFpVV28zHL8RRlpazSi4hWA7mnHp59ssQwA895 +aOn6JTLA5cpqN5PvOMAyotQbo8vF0ADeaTGih6E/GpJ0h1Uy4j9XeOeLvSf7arwtJce qCnqjHJrWUDFReD5CyDQfQJfY18dBEtRyyZIVtbliu5CXer0UovAcEglDgu1lAWI2jtU PQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmu813nkn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:18 +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 273NCUeA003017; Thu, 4 Aug 2022 03:41:17 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hmu33w4yx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UQ3cd1alsfTZ0mbl6H36qqZk6kA0PEKv5HS/zr0uAaG6UuC5NfvF4lFCus4KyoOjYHYPMWSOZUogViOaBCbO5N3u5APrLWIRLM20waqNHvtOrAjMBooUVFc8jvi5FMO+FQy61yKiY75NNoSEolPBLtmxKjZOmYYC/Sp572nkGoc0j+EjDYaE2tv3KuiK/9iRzg+hegXPjNeoujK0FBzIgU4cTrgNQPa0qMsOZxCzntMiQRpX1mCpfte8aQhSJzWeP81vseIYbTnvOnUcjZ5uuVZ1n6ad279Ykn0z739rtXcHkxm3wBiDO+KNVPk1hGWi4BlrPNbetJ7u3nrR2HdkfQ== 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=RTmmg52yunYnZHHvRKyJCmSkaEhemyWsf4GOOhkXrbE=; b=QQLaw3HrTRlaOT0YzdxVZRI6YkVurKrNcmJJduAhhRXsoQXekfp9rDU10EOvQJlsQHubx1TFkiKs6YwvBYrgAaTTY6Gbrss6IoNaf9lPLxN+yttRmr8naPog4gTQxLpx4KIROyTR6M58RjbifHqBvUiM6Tuy/j6MLpsQcAjHh2U4D2N3oO0toaIZfJuU5I3/Gm4oJM04tE/G7owgojfgU5zoZyRgU2Y+fv8ccgXRfx767wtnHN/m/wo+Pyk31ywfLjZUe4RR7Wk3hIzBrVk95MqKjXi5ZMmJ/IgI0QF2lJBwGmoxL4bhSBfxD4gs5BGwoIcktw2xKB2VWYclOZN5YQ== 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=RTmmg52yunYnZHHvRKyJCmSkaEhemyWsf4GOOhkXrbE=; b=ACKYtLxuGuoTYrzQbz8zEzUH814W9fNdpjVf+fCMorvAH2azfO4WT+zxkIPvy053DkA8o7C1lCI+oHGpd7uXgAuxY9k2GzGFZlEVezay+84fNz7aVOKLEwydOWsiGpxJAvMKdtacllWTxkDmwpEJrbaKLc3gYGNqfwr7kqIlkhE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:16 +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.014; Thu, 4 Aug 2022 03:41:16 +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, manoj@linux.ibm.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 09/10] scsi: Convert scsi_decide_disposition to use SCSIML_STAT Date: Wed, 3 Aug 2022 22:40:59 -0500 Message-Id: <20220804034100.121125-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0101.namprd03.prod.outlook.com (2603:10b6:610:cd::16) 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: 12737047-2af2-4f62-c118-08da75cb2f53 X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2VSJG0X0CCHtEaRdZHzny+Whr+qDTEC9lVTzP3NWoa4RgbDp2AOTT7ifM5KEcuy8SwV+4SA/5Mg8yXjcmsHyxt/LnlwyunwZWAyrdiRf6K3U2d7zaH6MT28Qf+C7QcBAkDrJPMHemMmPnzXiBNCiHmINKyYKYLCPEC3vCU1jNU/+pOp/oIw2n5E3yZpMU7iZMV8RBcATl0XqI6RPZfJQaPzfrz7H8VXFNXelfzF3MhGhbCk6d6U4G2OvCerYsz/SR5JxQX1BymAGgHuM8wFAh0+hThnKTPS0Q/619a2iS1II1bEmp9crTlp9dvDHorajpr3H7NEsq0h+p2rjH2xuGoIiwjnTWxcUFazyhaWsKkvjqlz9YYJKLhw0Hs4OK16m5JysroWVWj8zgMxXwsfVIUMkgJTY8hltJR+phG/5GmgA7+3/BN142bDZHbPgYqw+bs8j7jBdxkaZAZWape8p2l8rMlojNcs+bd3ByxkwOOQsivZGE/4kcWmBRWCLKjKf8jMSwaROGR+VYtFUj4YvRXW21Fuk+OwBr+F6DBSu/POdsCFweLFv3U6Tcl8ZQYyyqOQSHRJQRBwRhE0fd/qRbQ+8IsmBDO31GFYvF/9Yf1lw5SWtPwy8sxwUuIe7nKFx10G2hYEPfGLPhs7q/P655avpSnbc2SaOBl82dPGgqxcFf/hQrQuUqBEtPVdACmDVfN/EHB4pKnov2to9Vuk0lviZRsmUfcOzWKGMC8fCHl32Bm1LrILzjqx1X7RALXCudjoXKoijFymMq4rtth8GIBZVRmtS58bZ7zKuXlSCNIc= 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Zf4AsTb/ZWR501+jejNrJZuJ8IlhFdRVjWIwDlCFcAiMjRptVjr+fdBZyoG1MVoDTexma3RHMLG4e+ICyxdPSD8xmPocu887G/s0fTzzGwK2GZSW88cgk/5IqPV8yvDK07jMIJR9J3xEcirHbgwH7Y2zkRVVLu4whJDqyi2jRnlMtoy07MVrGUXIaRdRnk06fu7vlqWkl60g22lTjM4fqULqgep0rKYwyrMjGV0rSFsHAKgkaC1Y2M3wMPszihTczWYBFK6tjjjJnybd1GAPwn4O2lsX/fEiOE9xG5ndoObjC2fUt3/D3UAVC2UdWixQWyIHYZuWT2TjOvtHUZA2utFgbVyoFLPsgCEnJMRxn9x1Q1ovEcXTaQKJ3yfmCQHQgNmEOGjsbNFOTPmQisnN/UTZt9aQV8QAf0jjGYmiqEMb8T1Ik9W3HpEidPp86LSErNA+lCr4n8uMgOOgln6Tm3oTzBk10cUVXrg3c1317LSK8b0/lwyguMYt2LJmkpaSMdyX6ZPiyEMILYB5b0em4sFUHqhiC38erjT7M/tqVwgbC5GMCTXgFVn82TIcFj4uZbHhyKMpBKcLUN9QfKt5oltqICxG1EyCZ1ilPggkinLWH/rDq2FJ5aXGURksI1XhRCn9bplcPJXAJ/ZQ1esUVppG+STCPRCKPBV5eq7KdKuJRICH2lqFM3icfJR95yhsEwlyTa4br3z2w58UPRuis8ej9QcvjDZDSepzbhHv0rcWHnNZASQIUssAo1ZTyWfi8mAcDxjvjAootSd/kgTkdCq1l6qdpM7iJ9P7eBbBHoY0/yBH1Ypso/vjCGOrJBj9BEBHPX+cyy+phA8yLlgJnyvpc7QwpFwRF4d4Dkhe4wFNPM5AEqaNf+HLF/Bi/ucZSIZKv38AtNdrlj74Kta9mIZEBr4+BSdoHjcMp6fVOgsLfkxtS8h+dXRBnGpggROgiFMFhoWFrSwJu8bS/pwzJIsBh80bUG83O/PnOnhw/dvO4VYLa9MbmQQPmsuqmAAwhZ7jQYp0tAHT+RHJhK1fUJrhYT8qWl0OtEZcftf2wN2GBp/IletoltL2H1BGblE4WzS4Fj9WXA5Lls7FeJmEDO4OU6ilervkTtzrLH5oj0R8lrzfXOLNxqbFY3pTjXV+EQW6dFaQhPavJR9SCg2lrz1oNkMV5cROWiIV3+dNLl2B5bujWSqjoj8WG95pVSD8pGdfJM2tTLzTnzTnGLB3lCYp6doiV2JBELUVna0I0NecqkSzLpbHqF0pGnVC97G2d2yP7b006JtM+TvTnnPoGxom/HSxBfm8M6mcCMD0QhdSq04fW9VMufCcdeJi+ysHBoV4R+b7Qc2eb8/Vg5JfBpxrKSUOYTjzBO1enuQK/UaeWui3UQKuD8oMjaaEG0A83j4dmIstmiV2/sDA7qywq+Ml2uVyMPZDARlzn9flEQus+L4R6XNLfv6qn1VH9QEDg3YIILeZd4UFawYXPdFeN29T1dPBP65cVtkxotOfWIO4J/UYStk9VcXZiRMx4Gr+bC+2oYDZXgnRmSGBCglWJ/o5ExOd3xtaMc+nU1Ni6JBrPa2I755G35kAsPQj5bdEotJzXdVk23bPU+GHLCxh7w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12737047-2af2-4f62-c118-08da75cb2f53 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:16.0112 (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: t19WMC8geldU2+QLcpavgmaoJs1rjjbq1is9JPJJ67rj+OMWHdeo7xs1UGv3ROmlLmHYiVjOpgOsKN7uTDIBIKnKyt2F26wXixj4oYI6z50= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 phishscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-ORIG-GUID: 85lg0uSOZW0nvnTW4dzvXn-qMG7phaDp X-Proofpoint-GUID: 85lg0uSOZW0nvnTW4dzvXn-qMG7phaDp 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 4adadd3fb410..dd6a31dce3eb 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_SPACE_ALLOC); 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 eaf4865a2cb6..92a643ff64e4 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 Thu Aug 4 03:41:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 595446 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 C8F7AC00144 for ; Thu, 4 Aug 2022 03:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238429AbiHDDmF (ORCPT ); Wed, 3 Aug 2022 23:42:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237474AbiHDDll (ORCPT ); Wed, 3 Aug 2022 23:41:41 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC7C85F112 for ; Wed, 3 Aug 2022 20:41:28 -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 2741i7aF011138; Thu, 4 Aug 2022 03:41:20 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=XwH/z9y0DJ/bp3xDmx80YWRCfZLLK859YJh/LMBeSy4=; b=02ZXpFTPOFgh8KPXEDTnUx7wLJKC1QVNKiSBw5wfSNwaYjXRDToXs2ZEmw2U9LUcFSO4 Y4+y9QnnaTOjLxthtUzaxCDMlNyGZJIYV55X1OZUyY/XTgwK71/qJl7QFv+OlNNDai+V Otg2hKnV1KdRdqP2Zyxm/XKC0kKJBSGyy+INhqd+PWYPnD8Do67hcnQQVfYrI1TlqUr1 v2/PQvh7K9zvaMiLYNYBtX5Pd3zugXPACIepGLzsm65qiKZSSmKkUeTSFxZRYiRBt+qI XqKAc9eBnIvZdOIxXluwoA6oqLsKLTTGOzBh1QO+nj7xciUICjpH46D6Bkl1mowjNVTK HA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hmw6tkpwf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:20 +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 2740aWIH000954; Thu, 4 Aug 2022 03:41:19 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hp57srtby-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Aug 2022 03:41:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MTHfWHDKE9Hloai75abUpljzDk5l+1UxygByyS+LTBVyEUe2zOHV5Z1nuyVSlwE9omAnvQEyh7vRYnHEGhxGqWgt7YhOsYfeA9glBA+qgghW+GexuFK9R97puvQnx+zImNUV8JqIpPw0qI0mts4QA+MxUGzm4zhRpwxb4miZdHgZUiJ0sTX6ZMU9CRBEloL7f50tO/1F4j3ypGG8UoCCzXgrsGmEQiLYD+VbXwysDR7+5AhLK5arwmCb35dg/NBnfsiYKgiEpWdUxvzTzFiyjGBLrrC6qZ7i8SMUxWuC4NbdWkq+cefCA/TQlLfrqaGpWwXbnCriN06NbltSPEi4Og== 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=XwH/z9y0DJ/bp3xDmx80YWRCfZLLK859YJh/LMBeSy4=; b=mcVRAjuZ+2gKBDbRr4kuxEWX6i3ob0Utn42yZi1Yht0KEiLUX9/3X9EgCSFoGpRubS2Ae+su6VyJ72Elo6IUjsf5eqQenHNGNNXMrYPsULIVBcvDrjRgY0vbhAbr4TbaCOSws+6TnR2LYRYDkS/dzdakjjdQeicid3k4mGc1MNpApDholuO73i2xGudsvhsUXmawcBzl4j6XWUEZ9opmzvYe7eVGONugdmhPYauSYx8e3d/JLMExBopKz1gjRzJCt7AMSUQUfZt7qXszxnCmplzvyZe7dS7017n7p/S/v8H5c1jD5nIemSP7XGb8AN+CaHoYJoReOiFgztA4AT7X2Q== 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=XwH/z9y0DJ/bp3xDmx80YWRCfZLLK859YJh/LMBeSy4=; b=PWgmV9RMmhOL2iJHPjn0i0pva0HZhRIdLbuu3KX330qZ+npt+tPbCc5ngSlAIWvwUQiBfIsQ4VT1OxGQ9zAQ1dth9D9HpVUqSLnz3JRLu8RqJQ3VI+MJbVr7DliQrG/e4zYFjPxR3UpKh3YibljPt8OM9+QdiDVxgFgAlwksVGQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 03:41:17 +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.014; Thu, 4 Aug 2022 03:41:17 +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, manoj@linux.ibm.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 10/10] scsi: Remove useless host error codes. Date: Wed, 3 Aug 2022 22:41:00 -0500 Message-Id: <20220804034100.121125-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804034100.121125-1-michael.christie@oracle.com> References: <20220804034100.121125-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0118.namprd03.prod.outlook.com (2603:10b6:610:cd::33) 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: 30deb507-782f-441a-c70e-08da75cb3020 X-MS-TrafficTypeDiagnostic: DM4PR10MB6037:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AAc/Z0S5wL0zjuJyn7AtW/NyZa9yAUO77AYhay90plF8FJrPWtjv/n09lLCPm0ZN/xs1U9an7dULrxfuvE6z8MAwWH+59I6QohNELCTRhEwi4fguEMoNp64xWL7SrWjFlYGxJ9wZYX4I2PgeXKy99Ewq8aqYbylwYbG1UrWfUfznJ96fUSyeJBZPz+pI+LCUKOmXIPqQkbpiuLACurbLd+D+gwV9FuZzjobVI7UYumHmlCt3Hqgynz4ZlB98xJUmAI9oQ8c5H3K9W3n5M6P4M0gB00ZZYfObq26XNJHMq+6WZ5WnfN+uCyH9zixBo1/LUA0TYCNrxpeRcIQ32rIrxLuIymwnLDJUROgk9hwU8txCDxJ+kKMvKrw0dnwC5LAivsRV8jG6HU7E67NLYnMoAwOCwF1iFON5ptgpm/CNLjX+Qpk3GJU/rhhjiKD1ZxL6eHAgeZA83E1/n5ETCfA7GP/FJwW6qjSaUXbXSpA0MQUKpdDQi8gp009iASUVhQeFvhJYLNBswjIvdwyc7Vden/JCWZE8OgJuTkIYL/6RXbPg3uSO3JFi6NlSk6Vy8F6d6rm9kmzFA+snZZCCAcou4qE3o3uejA0TcCEBwXOvZSq5AVAX7hQfXlxB2CPJjB09vRE3X0dBK/9bGZ1fiOXA99JDJ14tsLIDamw4iZS8fmy0f1DQgFdDybkxAOY4XoweLSZ4lsPm7iN6mUgVfpTtkaR0+KcfwqWcgGfHcBJ7Ow8TJe/N3XeJJXg3ZI8qaAmj4v1Wh9zmVtGzeUeAuuNICw== 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)(376002)(346002)(366004)(396003)(136003)(1076003)(107886003)(186003)(2616005)(41300700001)(6666004)(6506007)(7416002)(36756003)(2906002)(5660300002)(478600001)(6486002)(4326008)(66946007)(8676002)(86362001)(66476007)(8936002)(38100700002)(66556008)(921005)(83380400001)(6512007)(316002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: f0US8RGFqoVIvl2HOVvORCVIzng9oWkrbDHUroWslBNLB88Qo5h6IH0MczBGwHeGUv+x/eqIXuiqDlyHmHO+zRSl9V7oMoblsNzrDYAlCMUNYsFiZ1qj5Vn6Wz5EuDyFIp6YHKezP1aASeIXwG5+OtmMZ/SjRdwhZJAcD9IGYH5Yby5/g65NqtqRIVTcn7J6DpX69peOcLP1SdYteH6z+QA1YdUzqVFsCSDfE+1x/r9bocGaaz1ccOTKM/WiErh6Wk6k1a7Aw42/1Gw5ej8zkPNf6op29Psb+wiRnvmi5yI+KiYvDdzJuKcjO1rhT/RmfkeYtVRERdlLpWaPbaNWqfGnMeMtGOQuq0zSgfFATLFRE9RbdARL82a3qYz8TJnqpGje3IppfqaKObPIh2OIN6K+vZ9MA3sSoaSZNUvlhWSm2KfFntbdbHq3PUV36l79o+jwLR7rDosEsoR9hNJA5vzySCnA4AoxExIQSdHSdW04Sa6BHDk4qPw8XhYRmwfD1bbolFSC/7mhW7sf3hGD3OG6c+n/S5ZjxVQwZDgICRLLqsKNVdqlRnntQ6AW+YkHvtBYuMpJowRk8adqM32o6jI+1yzi7/Z12gqZHSMCc3PVFxMTYMkhKnINpXr61OUhqLqqSZ+FkK1wGPc51F77vMeGxturvtc/Yspbw133s2jLLJVVRUw0g089VVR00mggIVSIQatWLhxhdI7QQF/yp/vZSVWncSUqTKfviea8hcm5iHIl0yDsbc6qj2YFV4Fjqifj5El17XceWOhxT5bKgDXmfGUwpc2gkgr07LTeYBh+ABfV71CFEB1si6xE9EfJTPrVjpLwMnAB2pBVG3bQYwBNWmCEdbSaV0CUYxS/vt0PsABuBgqSK3VUkc/cw60bsj9Yw/tSMOfLpmy5vhzbAU6yN2+X0JrQErDw9XPPo+CpvN2SlVPXVSRT1pSdBwoJ85P7Ow/r2k4Sy/jWWYEY8SLfm0lBIlI7kXcy9V8OsV1Trv0t0iOWoBhjj0jIxVXPM7TuaUr1S2BVtjAh1Hn1M6HwoKpbwMo7vyicfvB/8mvlfyl172tCylxxWMOD2jLS3eO2PAf7XYEkx818vONZGFBZdUo1S+grJNbkSmrow+k6PjmIrfs8uCokZQGr6EEEiocKRKBJMSbM/CwhPj7upcJIjRJeERPD23g/benGvuZOawU+qXC2WtZy8wsMa/hQe1H4LjkQJh9TC0B3hPS6BmuKSXqRKcHQW6VS3U+XS+3DQzxhuOKBJXGtH/C1isUVJQV91Mgy+CqstBdC9EAaKgTDq9yGGQ8Lr8POulX7MJBMLbrmw+vulxjA/QCezEDnBqOV59qv0h3jo6ohzn9zTh1KURv5Fvqz9Kp1ZyRBqCmRl7WAa70xnbz3FnaCHXlEQ9h/4+Qbt097iteRaB6I+CRpPxAFfEeilMVHrRjpvXkeCrZm4bTOG/zeiliYRzvfmPKBzUqFifqRcK8TPuhyZZcO+x5QjOXMBjplQjXBM3QFO5Jg3qZvbKbNP+uXumY+0xuJFh3Q+n9A4Rhtiwi81btzTjMhARwqTGLnKpSqdz+vVuktqN5z1lzg1jzd8HlbtaYzqMgaypZTyUVI1RK8jg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30deb507-782f-441a-c70e-08da75cb3020 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 03:41:17.3393 (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: 1UmJYoUh7VVINEu3yp7hgivYCtxHJzvJ3WcDiRkTKCGpd7OkJIMy1hHGwZWXpuAhGVZ5iEIf7u2YBcheY0EyQA+r2I7ZamDpE94KB37vP0U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 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-03_07,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040015 X-Proofpoint-GUID: vEEqYEy8lgPehMNmZl_QYsu50a6A28n2 X-Proofpoint-ORIG-GUID: vEEqYEy8lgPehMNmZl_QYsu50a6A28n2 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 */ };