Message ID | 20230928073543.3496394-3-haowenchao2@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3139882vqu; Thu, 28 Sep 2023 00:49:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlSwTk9g07WtMki7PSt6vygSxpS/67fxr2qqFEVZ0Fi9AULpN+R9W+z4QmiLT/jJEQZCUF X-Received: by 2002:a05:6808:316:b0:3a4:35bb:edae with SMTP id i22-20020a056808031600b003a435bbedaemr435562oie.29.1695887354961; Thu, 28 Sep 2023 00:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695887354; cv=none; d=google.com; s=arc-20160816; b=SzEEPuCiqaPL6fPZ7VV6gPItrcvPcbBbQJkrhCPxdfQSSEZ4xPCqaCzEckM2LiP/qg W3vIPF87KCcW1txIlOoeFs5bK+CGoarmsxI0bnOdRrjVaRNMO+1b+N6jD/09tfW/1Vtv E99DpfvQ2cGA0qJiyecM9DV4N1NrWg0tlFV0c1a9fuPA5Y7KugQDMk7qUVTqMD7gxWFk 8br9Cc5Se3iIpAYliz/+KaGO/Ojzb/255TFC2klc79AmcjI4nGXf/ZOBWLfPGmYC9BcM WhBcGn1i5wBzJrwxP9/pSl8A/qvwEPjIE0FEwmx9bpiNPL7vJ1dveEVk+3198TfndWW8 iBcw== 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=iZeRx98V2MQ0Fd18TNbOm3OFqQpf69ucYWLQcz2WfNkxo581QPLXs1tR+RaLp9DPJz c4CRxxS8Ufiziy14SKPLp26vL9KbySCjEAMX6lwjft5ms+KJ/Hb2zgIsL5oN9FqD5iWY YKNtgAqDRoYUNKEGH0RCnih0I2KE3rFiXcfRMRAlyjet1enyXw1XHFgjzWX9raBOVg9m dGME6SJJb4yipfJkbEKF7lmuJFYaD/0mSBmpSoePvU9QG9dyRWNg7SG2xEjIuFNhLH/H 5Y02gClpkKqOBsZfT5QHW60iXQhW9SsVIBs3KepOPkeap+x2qyq6oZ+mtNe4rnxUM8VD 1R0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z125-20020a633383000000b0057d08dac754si6184698pgz.671.2023.09.28.00.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:49:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id E8D94806896A; Thu, 28 Sep 2023 00:36:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230227AbjI1HgX (ORCPT <rfc822;ruipengqi7@gmail.com> + 20 others); Thu, 28 Sep 2023 03:36:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjI1HgV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 28 Sep 2023 03:36:21 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6E8692; Thu, 28 Sep 2023 00:36:17 -0700 (PDT) Received: from kwepemm000012.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rx4tx1hVBzNnp5; Thu, 28 Sep 2023 15:32:25 +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; Thu, 28 Sep 2023 15:36:14 +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 v2 2/4] scsi: scsi_error: Fix wrong statistic when print error info Date: Thu, 28 Sep 2023 15:35:41 +0800 Message-ID: <20230928073543.3496394-3-haowenchao2@huawei.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230928073543.3496394-1-haowenchao2@huawei.com> References: <20230928073543.3496394-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: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm000012.china.huawei.com (7.193.23.142) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <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 (snail.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:36:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778266779361625613 X-GMAIL-MSGID: 1778266779361625613 |
Series |
SCSI: Fix issues between removing device and error handle
|
|
Commit Message
Wenchao Hao
Sept. 28, 2023, 7:35 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;