Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp873861rdb; Sat, 7 Oct 2023 02:46:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGG4P2mrTaZGdPPf5VRqCxvj84Jgaf3dSpMuAA6EbgoEBsjt53FvQQvBmhrUQ5w4hnAElI4 X-Received: by 2002:a05:6a00:985:b0:68a:2272:23e9 with SMTP id u5-20020a056a00098500b0068a227223e9mr11676560pfg.17.1696671985115; Sat, 07 Oct 2023 02:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696671985; cv=none; d=google.com; s=arc-20160816; b=atWld7bSwaP9C6ra1RuODWDzc06xWYnHcXO2SL90SBdXbDI+/vidq2KeGds9eWk7st A60Ud9Uh5qUort3DxO4M6BFIslGlWJNOC4WST8UBKAKTkpbiiUJyax6rFoEZTJOcpGRU CfKdFdwCkmF5qpGKhxdXVFP2NocR17FbEeyV1juJbHf31qe3ZNMgG0tDmdEKsLMOu2HC dutaIjlbHUvv2P23zlVv1qn7FjTxb5KFX8lAoMZ+SExpVCz+E04ya6Ix7x3UdhGoAurk x2wLlX7uFcKfCqqQGiJ9EmLcsIE0QqXExjvBmGWhy26ts3djSrwQFsXLGQJJfEoIjr9j brJg== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=ekOj/c3W3Q1lHeUKsGo63fChtelTD2u10vesBVex6Rw=; fh=3rjMYMZEu1wJh4UGfsBfwyaUNBYmqdQ38cGIGwsNVRg=; b=kOVKNiOuFgtqa5aM0TXzS/swW2m6mFYJIcBoJlMhWBQXK7er55Dm9BT2ksQ2Zs29fP vjogNQLReeZktCehv/DnxzQSSI+9229xihhL//bOoda8LmNOsxqFMcyvPm0qXxLyXkbS 0SGUm6MMEepEHasaikpVwySeApORegBgD/dMEkKfk/p5YmQ2dFBiev3Hujasp8KicU8/ uIYIE1tKFH0mPzIHI5WRc6/HSb827p8jKVhuj3Ef9h4WGtLWkvcY4LfK6f0qvkjjPTsX HWUx3CtP0ADWaYVlZMNWtTHuIxO229ZhXCtmJLI9k9HCyQ6RtEMrBZLioJO43B/Tpr6v np+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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. [23.128.96.33]) by mx.google.com with ESMTPS id n12-20020a056a000d4c00b00692dfef1ebdsi3151739pfv.189.2023.10.07.02.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 02:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 87926807C659; Sat, 7 Oct 2023 02:46:22 -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 S234179AbjJGJqM (ORCPT + 99 others); Sat, 7 Oct 2023 05:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234177AbjJGJqK (ORCPT ); Sat, 7 Oct 2023 05:46:10 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9485AC2; Sat, 7 Oct 2023 02:46:08 -0700 (PDT) Received: from kwepemm000012.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S2gLW6p4czNnyw; Sat, 7 Oct 2023 17:42:11 +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; Sat, 7 Oct 2023 17:46:05 +0800 Message-ID: Date: Sat, 7 Oct 2023 17:46:04 +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 Content-Language: en-US To: "James E . J . Bottomley" , "Martin K . Petersen" , CC: , References: <20230928073543.3496394-1-haowenchao2@huawei.com> 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: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm000012.china.huawei.com (7.193.23.142) X-CFilter-Loop: Reflected X-Spam-Status: No, score=2.2 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]); Sat, 07 Oct 2023 02:46:22 -0700 (PDT) X-Spam-Level: ** 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(). > ping... > 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 > > 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(-) >