Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3292808rdg; Tue, 17 Oct 2023 10:00:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBkioaDgdQKReSwUGqJ+gtNCgJY9KHzedceoDROUq3lbuEf9Sx7n0iD9wm0azGE5PgTeks X-Received: by 2002:a05:6a21:3d83:b0:154:4246:d63b with SMTP id bj3-20020a056a213d8300b001544246d63bmr2572559pzc.25.1697562058646; Tue, 17 Oct 2023 10:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697562058; cv=none; d=google.com; s=arc-20160816; b=c2n1QVPVvgCzLE7TowiEAVKMjIO1v9VX1oawB3e7jro40ODufQ6Kvf24OeiYKkEW+T Pi88DCwwUhhZYUjTr8w3CWa9y8v9l1WedsPAz00w6+Pk0mo15A7kLCbyLLf+Uf/Se63k pBYUbtejXpsttVbnVgitw0KpcVkuL0z7vhwK5/Tn2IyGjzlj69HRbwRJcAQDAaD9Z8ZH T9mXIDFfdfGnqtPGd7fVx4/HQYGUj0KDkhRXsRSG+LRpiVKfvbZ2eTWc9UbC07Vqg8KX TcDWrekDlzieiA3/HiBOjY4aS1Y26mwT6qbYaneFq1r+gbW516121krdBhR2Zb2at2qx 9URA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=sfOHkZ34E86vmJaFpGPJUCgLZ0S7VG6ME9bd2Mw/kBU=; fh=5jNvBM0CJ1KIOB79oaa3p1Zq7bhX+eQVxatSdBs13Zo=; b=WKmH5VAyG8dJ3Yfc4eW0fNX2ob1GIj9C064uqvSfohXa64vpmVpiORfskZjD+mddIE l0a7HWU3HAZ5MuFZD+PnrcrNH7/eaCyE2UdeY8MPagHTiR0/z1zryEqDf6IICtohIrmd fkx0XqkNVriRQ/CkcPBFBpBtodv3fFWPPYE0/DzVkC+7x587AGw84vxD+4hMOM0lbSA6 FeisoTuvUUO+scrrMfKYvNtSJBwHaRTdM5bLxmwlSJmqNgnwK7uYJ9z7BlgG2Ar9wBOk Negv7vPjSCNCQZ8b1E9Ucyi51WkKUvMlQcDkZdnpHsP6iuXKEKh5oxG2WgA6gd0X7Obs CfBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dHzR62me; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q36-20020a17090a17a700b0027d29e618f7si2044971pja.78.2023.10.17.10.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 10:00:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dHzR62me; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id CCAAC807748B; Tue, 17 Oct 2023 10:00:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234287AbjJQRAr (ORCPT + 99 others); Tue, 17 Oct 2023 13:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232268AbjJQRAo (ORCPT ); Tue, 17 Oct 2023 13:00:44 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BCBD102; Tue, 17 Oct 2023 10:00:43 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-d77ad095f13so5985771276.2; Tue, 17 Oct 2023 10:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697562042; x=1698166842; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sfOHkZ34E86vmJaFpGPJUCgLZ0S7VG6ME9bd2Mw/kBU=; b=dHzR62meExQmSexGEdtAS8R3DFPMCro//1GopyDoaGP076HgtUou01EjjsjlOy5sL2 H0m4vfA0/LYI3YqdDOFngX1lAfCkx6MV3Jyom1sBZSN51eV10XoaD8ts6er/zpOSLb+e LcMgCv7GCbX8l7+JKFw+3oYtnooPZnKg5H9e7d7vQ6eyOG+uLsn9Cnaf4u6GSy1wvm9F SyrtHjWneNIHbJb81GPM1kV0M6U2yn6Zchv8PuKnpIWSnJHTXE+veaLkLNJq0t26x4L5 y5Fqc8vfTH73aa5IvAYzOTb+hSqWub/ga1hTAhV0gKezPXoIBgf1qdwOINm+TGn3VFvs TV6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697562042; x=1698166842; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sfOHkZ34E86vmJaFpGPJUCgLZ0S7VG6ME9bd2Mw/kBU=; b=VpFqMOldIvmCWZS9va2wPmklk/QcnRLnfkvVz51n1NA/pifHUjqyvfBmzWlqBLg5tp K3hN84Y5y8ga6CjRZdXiAEDgFkYzEIyjE3FB52QDt2OQKzFTNSwai3IAp8j6SiPth1lC dym0/FXZNDwTOwIc/GIxzI8MFcalt7OaVpYJVjxdcd8Wvr0P52mM7d3EBu4kkqSLR0Rb W5XSksKltsBb/rVZ07KNoAj+F5nGjR3c+R275i9WeGP+8n2wCjeEDw54IAEVXeQS/yEA T8sP7NUbC3AjqKkofGTscpJXHvTUnT1lrMamPiiSBysBSDVCO4RDzQjdXiTz/XgORcwA O57A== X-Gm-Message-State: AOJu0YyU2fec32XRacmvWj20dRzOyHqy51jrdGpaqmBLGGSkLVsIpObg qbfC7Umb40gBRH+RY2qKHSwxG+3SqsbQBiCLZoQ= X-Received: by 2002:a25:e057:0:b0:d0a:fa7f:2fbf with SMTP id x84-20020a25e057000000b00d0afa7f2fbfmr2677012ybg.48.1697562042319; Tue, 17 Oct 2023 10:00:42 -0700 (PDT) MIME-Version: 1.0 References: <20231016020314.1269636-1-haowenchao2@huawei.com> In-Reply-To: <20231016020314.1269636-1-haowenchao2@huawei.com> From: Wenchao Hao Date: Wed, 18 Oct 2023 01:00:31 +0800 Message-ID: Subject: Re: [PATCH v3 0/4] SCSI: Fix issues between removing device and error handle To: Wenchao Hao Cc: "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, louhongxiang@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 17 Oct 2023 10:00:56 -0700 (PDT) On Mon, Oct 16, 2023 at 10:04=E2=80=AFAM 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(). Friendly 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 > > 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 (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 | 46 ++++++++++++++++++++++++++------------ > drivers/scsi/scsi_error.c | 4 ++-- > drivers/scsi/scsi_lib.c | 2 +- > include/scsi/scsi_device.h | 25 ++++++++++++++++++--- > 4 files changed, 57 insertions(+), 20 deletions(-) > > -- > 2.32.0 >