From patchwork Sat Jul 8 04:01:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 117391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3720101vqx; Fri, 7 Jul 2023 22:38:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlFY76FNWtuSC8MvgeUEw+E/X3G3eYNACZsS2HJBifNkGXLMwphUAZnJuBjQvCPD8O14Hqn+ X-Received: by 2002:a92:d445:0:b0:346:4766:9f76 with SMTP id r5-20020a92d445000000b0034647669f76mr3363485ilm.13.1688794710142; Fri, 07 Jul 2023 22:38:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688794710; cv=pass; d=google.com; s=arc-20160816; b=yal5N0ram+YvVwh2z0xp+RAyb+pVtjRo3mO2oqglxc4J6pKhUr2jRlB2J/8pRMl/JY HAt5gW0rrvXBbnAnnr1H146x9mvG7aBl4XIBRY92nvpGRGRtA0CVw+kBLcsVLlfrhJmj EC1YhqVygQzZUl6/43grVpHikMvcuGDB1rYo2Nq61HXkAsc5DOa13gcSg8iEpnODQPdB igAVf/ty+t5GYAakaTF3oafAur5GCJ44gm+PImlpeJlS6eK+oTXJ9lYA/FmbzviOKYB+ ZX3x0gVPdbx3fWyApnK9stOM1UhGm6rtEx83DwzPWyAp7gD3IpPJ1cZhetmkamIWp+ms MzWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=BztoiYIdhqrXviWBWhuoZn0Yxu1OmL+D3mymQOyStHg=; fh=m4PsDP0UfCnXgVknzs8EPGZ1m0vka/NgBmAz6UwUXpw=; b=xf/ULPF1YV07/qrD4zjz6w4ASxhZK+3iK5SmMs4Z1Qt9Jubh1hd0FzHr93a8G97czZ Bcrs9ijn7kkLXhhKP91pKsWgKC70+ObW3LDVfHJitUW9IiLndyhX/z5uAk6aKiUyLEdV 9F5CfMiZWzpbqSq6xJ/NmCbVZgJbzeqosxf4C+YqNtihS/PdXSJBQzoGcFlnPy4RIzKq Dl/zirwkN4Flz5E1Se4niCuC8/Hr1Sl36XSnNTitCWcU0m2abfM2eG5J1E+FvDqbzj0g EOFmp7NiJZVPJOfjzejxxn8F7JFmclfE4OUR1NlTeKyGLRfw8klefeGvjSLBGeLG74hG 0NDA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=D9dPAxNM; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a170903018b00b001b694ecf48fsi5460760plg.71.2023.07.07.22.38.17; Fri, 07 Jul 2023 22:38:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=D9dPAxNM; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232735AbjGHECm (ORCPT + 99 others); Sat, 8 Jul 2023 00:02:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232672AbjGHECj (ORCPT ); Sat, 8 Jul 2023 00:02:39 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C24AB2117; Fri, 7 Jul 2023 21:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rq9Eoa9SXGxB5OZHmEUISlSz5tHO9CQCnPrIdhqsTCc09ZkwYeRJOMv4a9l5K+PIkMLk63A+MGTbKyYfIXqn05OWbB+oo4/u7U1DgrwBOaNABW3no8HL8kxdJs/ZWziAxXpNw23Owkup/U1+J77u2NWJYJZVoHXkXcTnudSAAl54MTjs1uglDus3IeVl9Ioev+XwKlCaCAK1IfACBuhFS/tWrAplBz9vCDxYqiknTlqy1xp8hN9YzTURzhh9oMkNSpYyVS3I+uoaIJ0cgZ0BUyJODEKOn5Ihbu28lChzjeY2n1DHOwAtRz/iqZrsUign5FGc2BEcZDloAzHlzo9+qg== 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=BztoiYIdhqrXviWBWhuoZn0Yxu1OmL+D3mymQOyStHg=; b=EwaN9BTc1TYCED4iLNxFO9zTU/A4oQg+G3nOXXHSLeoouk2mGufShtpOtAHFG1jtVZf8QBYrYbwH7aT/8gGK4ocVw28L7io1ZsTwxNXOIsIzw7jlcM8THSokc+3K7+M0WXgfaXssbqGNQqQiNxK2oz7PTn8e/h7Az7NQ79/aBdF4bnqaIYEaqEVA46lYdIMia7PUUtCeeiTv0oke5k3K3Z3UKWj+55wr3aQoGJ1PGqxtzUbjIpsjUBYOclHqpMcpk6pfltmsMHt+F6+tAQTM3eqeZfbvCwX8Zy1canv/n6Yiq4X53eC32906btefCcdoJYyan+4VUbVPUIDjpkYdnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BztoiYIdhqrXviWBWhuoZn0Yxu1OmL+D3mymQOyStHg=; b=D9dPAxNMzu36Y4Fw31X/FEvEfQXbClZ5Mw5yU3X5Yw5FOjUkZCQ3oS0n02Z3wQKDYy6ROGUAsPazubJhqbJrIqCao7g2CxKEPAQPhGhmSR6QvqgZDhbvVNOB98q291Ekn3iW02NJZMKCRld9EbzWLLsadNHXtMbYHJ4Nh8jeKgg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1370.namprd21.prod.outlook.com (2603:10b6:5:16b::28) by DM4PR21MB3419.namprd21.prod.outlook.com (2603:10b6:8:ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.5; Sat, 8 Jul 2023 04:02:32 +0000 Received: from DM6PR21MB1370.namprd21.prod.outlook.com ([fe80::332a:4b2d:9972:caad]) by DM6PR21MB1370.namprd21.prod.outlook.com ([fe80::332a:4b2d:9972:caad%4]) with mapi id 15.20.6588.013; Sat, 8 Jul 2023 04:02:31 +0000 From: Michael Kelley To: kys@microsoft.com, martin.petersen@oracle.com, longli@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, jejb@linux.ibm.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Cc: mikelley@microsoft.com Subject: [PATCH 1/1] scsi: storvsc: Handle SRB status value 0x30 Date: Fri, 7 Jul 2023 21:01:26 -0700 Message-Id: <1688788886-94279-1-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-ClientProxiedBy: MW4PR03CA0151.namprd03.prod.outlook.com (2603:10b6:303:8d::6) To DM6PR21MB1370.namprd21.prod.outlook.com (2603:10b6:5:16b::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR21MB1370:EE_|DM4PR21MB3419:EE_ X-MS-Office365-Filtering-Correlation-Id: a1132923-5a4e-4225-6504-08db7f682758 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W7rctVIGq1QS80o9QVyTpIxOm+Jim1OsZPBTFTIrwtdhMkl+I4EJPKrGOTCcDTMaVxkjgjpX6bmHnciCzfd8pzI7M5ccD9Y4UznMXF0K9bfRsGMlf5072kAlHKp5XBZXujLmnuc+q9OFvuFhhvdrol1XdrJyxnHa3eNxHPsAaMtM/E2oEqvtI0lHCrqDLuAXhUmCacDr4NAPuXhCmnU66aMaGyes2IEANrId6Ma/qZ5bfx3hg5og/I1xgUyJyKap0HZ88Y/MnJqSmg/6kIqe6pE4XY2fNrdLJjZZiof1lOYWmzVd1ODR9arDe8/AiLtSN5OLNsgSYr+qNQgzXGUgdhQC81vmXe1o9qlal/KrZC+7Qcyh2gn1cwe0380/3IQWzkVBRduj50leaLYHT6iVvQ4BHh7bR7KfNYW7TZmxJG+0Sebhk8AQDl4w0ItsoEsHFA9qVcDbo1ntnkE4S6f3d5tinXGNd/obThv/rd79ImKeJyvmHLbqiq1jP8rRLi0IeK01l5UwGYX9M9DDPXNIP3e3jUaEgUWwZ+rVvjLpqom46NBSDsaPlQ4WOUWOYSKiR1UlJ0NWR2a6kATPiGw4dZLRLaTmqFjcr8DCbHyhlQQHoXkrD+scOtYr4NAkusboGQ6aCVJp8iKlghrtOoZcC78zy/J5p7FVjmjDCP8bE9E= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR21MB1370.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199021)(6512007)(186003)(6506007)(83380400001)(52116002)(2616005)(107886003)(5660300002)(26005)(8936002)(82960400001)(8676002)(82950400001)(38100700002)(6486002)(6666004)(38350700002)(478600001)(86362001)(66556008)(10290500003)(41300700001)(316002)(36756003)(2906002)(4326008)(66946007)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VRHmdrsvvH3gpBkS0w6BgECDcwh2F46aXNmQwGP1I+V6WLDi+VTw1kArt7QzHQvY1ZYMd8Wp2pWFxtefopb7VPM8Oyik9MuZCj7a6khM7V5C4mNhtD9UP3gJ9cng3+8kIyKwCEVolsX9Lue4S6pTnWXwGzUiaFYqo1h69pnyPiCJgJ0WxA55C35bGjVg16XiSdyi79Mu+PzWWQGTG3o1LJkdO6D+QnX2ooG6JSEwtBIJgaCOXuErCp0eSdMY9jklyXBPcuK021uDNBU7YSds5VdiZ2T9GfXU9He4xGlP/OmRCmUwDgXe8aDxgxhdvkl0VkLH3FlBI33dZ27C6BKQh+YUX4HDVTBcG7Pw5udO8Oo0R/0p/Vo5wRM6MOE43pNErO+wz7jV80sRxpVz2ZTCTOolYMm4jb4uVLXYegeWBu23+sr5dQ5pvqFhkWbhPrPt/HPa3FPzjWA89H830kvwKZUu3xhz/EDFYnMKooNiG3Pj8QV0TiXoXL6JkltAgDd1rjgWa5gbRCny5L6zuNxBkl+AN4i1bQWFAhuUNwOqHaXmcWIGnD545+Ffw3i6zCDCc/s/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4225-6504-08db7f682758 X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1370.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2023 04:02:31.7944 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0Gn7PyVs68vcAZEIpv80yaTsNuKcoNbLOWTQFgMTPwpEsz/OYx0NyW0Cx3VOHjnOpKPCFCWJb/YNlCDjB0ARhg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR21MB3419 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770829601949174224?= X-GMAIL-MSGID: =?utf-8?q?1770829601949174224?= In response to a disk I/O request, Hyper-V has been observed to return SRB status value 0x30. This indicates the request was not processed by Hyper-V because low memory conditions on the host caused an internal error. The 0x30 status is not recognized by storvsc, so the I/O operation is not flagged as an error. The request is treated as if it completed normally but with zero data transferred, causing a flood of retries. Add a definition for this SRB status value and handle it like other error statuses from the Hyper-V host. Signed-off-by: Michael Kelley --- drivers/scsi/storvsc_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 659196a..7f12d93 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -318,6 +318,7 @@ enum storvsc_request_type { #define SRB_STATUS_INVALID_REQUEST 0x06 #define SRB_STATUS_DATA_OVERRUN 0x12 #define SRB_STATUS_INVALID_LUN 0x20 +#define SRB_STATUS_INTERNAL_ERROR 0x30 #define SRB_STATUS(status) \ (status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) @@ -978,6 +979,7 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb, case SRB_STATUS_ERROR: case SRB_STATUS_ABORTED: case SRB_STATUS_INVALID_REQUEST: + case SRB_STATUS_INTERNAL_ERROR: if (vm_srb->srb_status & SRB_STATUS_AUTOSENSE_VALID) { /* Check for capacity change */ if ((asc == 0x2a) && (ascq == 0x9)) {