Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1722067rdb; Sun, 8 Oct 2023 23:59:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFy6JPei56IPJaBSTjKK6IociODxJ4zjXpWTQQTWXCaOlp4mSJH8T4Qy/0c8ofO+vPU+BPy X-Received: by 2002:a05:6a21:3381:b0:134:2b31:e2a9 with SMTP id yy1-20020a056a21338100b001342b31e2a9mr15234219pzb.0.1696834770897; Sun, 08 Oct 2023 23:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696834770; cv=none; d=google.com; s=arc-20160816; b=AQICmaPlseZd0VvW1d38PHhgNSISet4WDQT8by7XSwUbd7rBXnah8an/rwBlc4E7l2 ewVmKVuIHTFPjgPGPGJQmRQE43LzaLWQYi+tEJVKccM2PuUuexoBjbwnSMkBSQhFrNJB wG00BbeJWSgdneYNIrM3697WiJLmODV5mjRAfj1V4eHqrb0xCLRhPgvlmRgidg5StThi rJc9fJLomJ03XmHLaNrBsaYZIivkvATTtdl0oLPQeSM9G4UOkSk8DxAkl5UhHAKqdhxr JiN1+KWdrvuY04PN05WOWnj4ZXjFH4jnA/bkM60uOR2U+j+6BqiUk6/SJ+6QEa7Sb6jB POmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=Ri5+yCbngteRzKl5C4cV0AsrYLLbp9/tWpYzLdJSblg=; fh=3rjMYMZEu1wJh4UGfsBfwyaUNBYmqdQ38cGIGwsNVRg=; b=fM/AQkYjO/Qgpi5uHoe5OviUUjFqDa+2nP75awkfSaFAgAo6n/aRzHjwltKzDZgoea ofNqdUId9pC1+8YCXN/bHmGWz8+n1josr/jqsl30hqIfL7whISF5KQP/u5xj+3K1Pg7p IXQZe+KWZ4lLhI3UJP8dUB60A9vlqiQvEA+ForMwyPsLHZHTcH3ATIlA/FXE65xub/zf zAdVEOqggqpyCDlXwVL/QK98o4Zqc8CG5fWtWWtk2qKOFmo2UeeLOXsjcPv/EL/s35Kd oy6JekrKLsfE00/dlDGbCYWkT1fmi9V1ot910dDpkXGgUGG3A5v80ILVrdjs4MN3p4Z+ iODg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id dc4-20020a056a0035c400b00690cff4a2b6si6595691pfb.112.2023.10.08.23.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 23:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id C2A1F80617F2; Sun, 8 Oct 2023 23:59:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345265AbjJIG7O (ORCPT + 99 others); Mon, 9 Oct 2023 02:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344984AbjJIG7N (ORCPT ); Mon, 9 Oct 2023 02:59:13 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E566A3; Sun, 8 Oct 2023 23:59:11 -0700 (PDT) Received: from kwepemm000012.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S3qYW0kL2zVlQN; Mon, 9 Oct 2023 14:55:43 +0800 (CST) Received: from [10.174.178.220] (10.174.178.220) 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, 9 Oct 2023 14:59:09 +0800 Message-ID: <05c0b3ef-8643-3fac-c78a-2d04a10bb188@huawei.com> Date: Mon, 9 Oct 2023 14:59:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 0/4] SCSI: Fix issues between removing device and error handle To: "James E . J . Bottomley" , "Martin K . Petersen" , CC: , References: <20230928073543.3496394-1-haowenchao2@huawei.com> Content-Language: en-US From: Wenchao Hao In-Reply-To: <20230928073543.3496394-1-haowenchao2@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.220] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm000012.china.huawei.com (7.193.23.142) X-CFilter-Loop: Reflected X-Spam-Status: No, score=1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 08 Oct 2023 23:59:29 -0700 (PDT) On 2023/9/28 15:35, 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(). > > Three issues are found: > 1. statistic info printed at beginning of scsi_error_handler is wrong > 2. device reset is not triggered > 3. IO requeued to request_queue would be hang after error handle > These patches fix bug which is easy to recurrent when removing device and error handle happened together, so friendly ping again... > 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 (4): > 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 > scsi: scsi_core: Fix IO hang when device removing > > drivers/scsi/scsi.c | 43 +++++++++++++++++++++++++------------- > drivers/scsi/scsi_error.c | 4 ++-- > drivers/scsi/scsi_lib.c | 2 +- > include/scsi/scsi_device.h | 25 +++++++++++++++++++--- > 4 files changed, 53 insertions(+), 21 deletions(-) >