Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3135594lqp; Mon, 25 Mar 2024 23:37:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZVl5EpzvMPdYdxE5epuJWJw9K8x8JUU6XeNQTydF2wXX3xJHQVqBRQhZXn7hcVdw8aT8YJfoYzCyy/Q/R6JzDyIBO/whFciaQjSekHA== X-Google-Smtp-Source: AGHT+IF9KYCNKIwQcB2JSCt6nfM7UZqE3moNO5gkTAVMId0LlqCSYDi8xj1qg5v+G4BbYqRMJAkP X-Received: by 2002:a05:6358:59a7:b0:181:65ae:874c with SMTP id c39-20020a05635859a700b0018165ae874cmr167311rwf.8.1711435066625; Mon, 25 Mar 2024 23:37:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711435066; cv=pass; d=google.com; s=arc-20160816; b=tpJwGKvZN7dSB12367sWQJtKYTq/8Il00x78eSVrbkjJK+S7exenGkkQVOlhkhKY9G TgpE0nmVasqGsvbq7vxVp244+EoPTua7f03KDAe4DFVlG9Bu+K+sIBf8UUlW2NK1r+Yc xfWA9LD+sqMrFCUe+1EHrxIuHhOAd+xt0qNMmjhpMUR8pBgn9Yo11PQpV3TtfmxGRr6o JuXmKpWifoDX0NoAxGpeeTTfH1gjl+VF5CsGh3gaw++SrfK7+JTbnIaFoIPc+LpfZ0tS qcmMwN3isS1qdwTLBZX8QN/vYSerGXDM8KIAYHuprSJYY5uCjbJNDKkfAd05m2XxqtFb 46+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=LJgNR/WgqMTLl7gMBxCKpziQITE9DU9NNIz1b6DFH/Q=; fh=24zFZaUZkYTOFkhWlF0HWibYxyET2nscapjnGCTPxwU=; b=pVqtfUKnc1eL525ld9vbczwHHl6A4WfQ1eIwv5VRRJxoewEcJ2V+rhqQagfWtoJILn XBwsENRTLL2CRoiyPUrhKObtnsiaRkPf1bIX37bWztC4buL9SKGSM8c2ntsYiTqGQ4Xn jfSL97pdhJQi/udyhpJbl5+PsL5yJZpvc+hY9yPB7cKIl99TrWE1S0mQi4j5bnZNNVFb Yc/dVxuAbFlTiGXgInp2nxFqsz0V0dMkaw8omYprtlXgrawJRLqpB+8yhndEmDv2ephi UPe++IOArt/YoiNYRwKnLXILBD7yq2SKUga9qHdM4B120wRVS5jv/wU0nMucXQIgoZqV Mq8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-118422-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c1-20020a63d141000000b005dd99dbfe0bsi9128568pgj.892.2024.03.25.23.37.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 23:37:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118422-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-118422-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2D1522A5661 for ; Tue, 26 Mar 2024 06:37:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CAEC823CA; Tue, 26 Mar 2024 06:37:38 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 662AC54BFF; Tue, 26 Mar 2024 06:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711435057; cv=none; b=XL856bQL7jJPkbIlrpwwaGYX64Mobhw1J5DlLBqDcd9+ZRxD0h/0BzAA6aV+JBwsZYCCeKPhw9hH5sSfEBlnBBvl9QCNtb/5hnx+5tVXFCcVa7BykqbAObovn8FbU0JsymeMWXnYK91zgInghVFWUigAlMbicM0tMOPQs8kfLvw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711435057; c=relaxed/simple; bh=u2y+vtRSLyiyZLwEmdo24Sm096aRMYJD9m5vspSuB8o=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=pw49hkmhqSXU5YfJWt3TEH/ZipjQjPJCe0liN9iDmtlGSqmPd7NBLa282zRn2vHVrAjDdqe2WNayiC9a5rvUEfQXvWbYgcC0jAHQ304yLsKP/uMZbtGOS5wwtm7+ag2wWRbrtiIYi01PjkbJ0T9yHA6cWs4iKDOvTJRed5kgNlE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4V3g5M727Xz1h3fb; Tue, 26 Mar 2024 14:34:47 +0800 (CST) Received: from kwepemm600012.china.huawei.com (unknown [7.193.23.74]) by mail.maildlp.com (Postfix) with ESMTPS id 4DB4E18002F; Tue, 26 Mar 2024 14:37:26 +0800 (CST) Received: from [10.174.178.220] (10.174.178.220) by kwepemm600012.china.huawei.com (7.193.23.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 26 Mar 2024 14:37:25 +0800 Message-ID: <267c4355-e930-4439-9239-bc78e7ab316d@huawei.com> Date: Tue, 26 Mar 2024 14:37:24 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/3] SCSI: Fix issues between removing device and error handle To: "James E . J . Bottomley" , "Martin K . Petersen" , , CC: References: <20240307144311.73735-1-haowenchao2@huawei.com> Content-Language: en-US From: Wenchao Hao In-Reply-To: <20240307144311.73735-1-haowenchao2@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600012.china.huawei.com (7.193.23.74) On 2024/3/7 22:43, Wenchao Hao wrote: > I am testing SCSI error handle with my previous scsi_debug error > injection patches, and found some issues when removing device and > error handler happened together. > > These issues are triggered because devices in removing would be skipped > when calling shost_for_each_device(). > Ping... > The issues are found: > 1. statistic info printed at beginning of scsi_error_handler is wrong > 2. device reset is not triggered > > V4: > - Remove the forth patch which fix IO hang when device removing > becaust the issue is fixed by commit '6df0e077d76bd (scsi: core: > Kick the requeue list after inserting when flushing)' > > V3: > - Update patch description > - Update comments of functions added > > V2: > - Fix IO hang by run all devices' queue after error handler > - Do not modify shost_for_each_device() directly but add a new > helper to iterate devices but do not skip devices in removing > > Wenchao Hao (3): > scsi: core: Add new helper to iterate all devices of host > scsi: scsi_error: Fix wrong statistic when print error info > scsi: scsi_error: Fix device reset is not triggered > > drivers/scsi/scsi.c | 46 ++++++++++++++++++++++++++------------ > drivers/scsi/scsi_error.c | 4 ++-- > include/scsi/scsi_device.h | 25 ++++++++++++++++++--- > 3 files changed, 56 insertions(+), 19 deletions(-) >