Message ID | 20231016020314.1269636-3-haowenchao2@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3189936vqb; Sun, 15 Oct 2023 19:04:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7fkL0NM1P7jVqyVE6OwAZ9rybe7WnV2yB+op3clWH+rzIHNfDn1OA8PoeUrPeAU1Zib9I X-Received: by 2002:a05:6358:2927:b0:166:bed7:b4d0 with SMTP id y39-20020a056358292700b00166bed7b4d0mr1301263rwb.1.1697421850587; Sun, 15 Oct 2023 19:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697421850; cv=none; d=google.com; s=arc-20160816; b=S2HHhE5u2dWwJ9SlZ5AfbhgHiAqNM2q5L2vrIlQ3p79vNTHtnI9JVlJg/A4NDgXv0y rpGEVLJszlCCtoUFBWVCmH4aH6rO/gpDyhK7JBF0nT/pLBRsv2II4g2lB9t3s6AHxxhM BifatM8NX6kW93qtmlB5yLZOjVtVI7I7tp0LoV808EO++subvKbUqVvie56yEvzGF9rE lBIZup2s6s5P5t/M/0VfUYv3Vf3RwpkRS7r2M5QPsHiqMMEo40ekyqO8jQXhH9SAU539 itLTUWpCp4cT61+XDOPTZg9ch+mZ3eU4UeB/c6915Kqok4j8rb7V+L1vQ537huv+nefj lBFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5HXWY/1eKTi2AaycFfWdMtNMxCXH8NCt5M62vjx8klI=; fh=ZDcIlyYggP5K3GvQBQF3K/GzUnCJV+bQb/1GDPxM7E4=; b=ILPriOuXcgnkGdleCjoBQ5gkwMX+zeIIkZgrp4OGXPIXrtYSnXN4lQ4lx0bb/TAmmL 2zMY5PQRoHCpQuyiKvXzHPIcgpQMBlKKOlqZiXwA1ambzBtxmcB5AUywBg34QyDSsC6n rv8MBYnhovfHyYQjptmY8ZXiQ/ugdS78YNQck7mY9O1HWiwONlAUHajHEt1lK+sq1zgy 8nIiyn8yMkMHoTdcL0j4zBCnK0AML2EhTQI3lc05XZ8mjCHYzw+Ur0VQXGOea8cqNqH4 LIiADuif4+xTwZ5N1YUmrwYWov0187TUoaa8Tu8IJdr1yrY/oq+xlFn8Irxhb17/JJV9 gBmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bx38-20020a056a02052600b005af15600342si5686043pgb.268.2023.10.15.19.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 19:04:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6672F806155E; Sun, 15 Oct 2023 19:04:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230527AbjJPCDk (ORCPT <rfc822;hjfbswb@gmail.com> + 19 others); Sun, 15 Oct 2023 22:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbjJPCDj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 15 Oct 2023 22:03:39 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 374C8C1; Sun, 15 Oct 2023 19:03:37 -0700 (PDT) Received: from kwepemm000012.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S80g125lDzVlcD; Mon, 16 Oct 2023 09:59:57 +0800 (CST) Received: from build.huawei.com (10.175.101.6) by kwepemm000012.china.huawei.com (7.193.23.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 16 Oct 2023 10:03:33 +0800 From: Wenchao Hao <haowenchao2@huawei.com> To: "James E . J . Bottomley" <jejb@linux.ibm.com>, "Martin K . Petersen" <martin.petersen@oracle.com>, <linux-scsi@vger.kernel.org> CC: <linux-kernel@vger.kernel.org>, <louhongxiang@huawei.com>, Wenchao Hao <haowenchao2@huawei.com> Subject: [PATCH v3 2/4] scsi: scsi_error: Fix wrong statistic when print error info Date: Mon, 16 Oct 2023 10:03:12 +0800 Message-ID: <20231016020314.1269636-3-haowenchao2@huawei.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231016020314.1269636-1-haowenchao2@huawei.com> References: <20231016020314.1269636-1-haowenchao2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm000012.china.huawei.com (7.193.23.142) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 15 Oct 2023 19:04:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779875814371698033 X-GMAIL-MSGID: 1779875814371698033 |
Series |
SCSI: Fix issues between removing device and error handle
|
|
Commit Message
Wenchao Hao
Oct. 16, 2023, 2:03 a.m. UTC
shost_for_each_device() would skip devices which is in progress of
removing, so commands of these devices would be ignored in
scsi_eh_prt_fail_stats().
Fix this issue by using shost_for_each_device_include_deleted()
to iterate devices in scsi_eh_prt_fail_stats().
Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
---
drivers/scsi/scsi_error.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index c67cdcdc3ba8..2550f8cd182a 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -407,7 +407,7 @@ static inline void scsi_eh_prt_fail_stats(struct Scsi_Host *shost, int cmd_cancel = 0; int devices_failed = 0; - shost_for_each_device(sdev, shost) { + shost_for_each_device_include_deleted(sdev, shost) { list_for_each_entry(scmd, work_q, eh_entry) { if (scmd->device == sdev) { ++total_failures;