Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2791387rdb; Fri, 22 Sep 2023 08:28:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+EUgTEdN5OF1gC1IdpcLH4Y5suaEkZOyeD88H/55QYJ9ezEwpQouxgXrMlG3TMoL16vT/ X-Received: by 2002:a05:6a00:18a9:b0:68f:cdf3:dd54 with SMTP id x41-20020a056a0018a900b0068fcdf3dd54mr9113248pfh.9.1695396523627; Fri, 22 Sep 2023 08:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695396523; cv=none; d=google.com; s=arc-20160816; b=DqHTWdAR1RgsKLSz34NdKLSSDHkZ+B8PTTm4m1NvBschS/ubrLgKF6fUDwyq64kepH cFgZt6rterLAaoQxRQ/MX0m6wyeZA76xl2/f/wXnYPDQ0pEFX5AHGyXyAAT6voKNrdNY EpXHZPuDbp907/5Z0xfI2d49XPNlZ5j2ntzaVyRMWcxO14c8KltLYrIWDemq7W5uJ8pp sE4MOxAB7rtzXeyD1HokU3d+0ttQPrGjTVLvQK2bXqaQVZ2KsiOj1GUkjWoSPTPP717Y mVVw7Vocjb6IR3hxAnHiLsrHLhZ/y7phPgtfQJyz9b0fk5AJoR6TSYgaeifU+RO7EQs3 k9Jw== 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=WZ743c23h82eWXrVp5Ju6MBdvRvF0AFD87bTIsRHhaE=; fh=UEpFMKOqyweapDowiE7VvOt2ySza3HVObMQ+Ezn7xQ0=; b=UvaJA6sEIS4DkwJzqmng/5eTAGTIOykSO0TTMHQLvqFiPV1OICPwvCFa8KOzBQp3nB hVzPAD8m+RxNxGpnMX/4vcqD9xEXyq6bpm1i02MAuMjuH91DnnO9E3Hjvv5/y6WtkZMj tOhFD0BdvkccHBvukRhBNCx6+pJOMumjzSoWWpxKCdwvb25le5tZ4SmlTgTgd6foRJmS /VmEmsnvBG88vpWCcztLnnEpzIM3hsDax7rWAc/yd8A5uwLWgMOZs0th4TGLHVvcvnRu AL16akxp8SM/M5pZXcMKnDRnoWRZvXi9yvm21cN2+rBEKbmdjwTOCaBbRNv6bj3hvBI2 Or2Q== 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:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h14-20020a056a001a4e00b0069018a768cesi4150913pfv.405.2023.09.22.08.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3E5D08237864; Fri, 22 Sep 2023 08:23:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232636AbjIVPXZ (ORCPT + 99 others); Fri, 22 Sep 2023 11:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229986AbjIVPXY (ORCPT ); Fri, 22 Sep 2023 11:23:24 -0400 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B865A1; Fri, 22 Sep 2023 08:23:18 -0700 (PDT) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-692a9bc32bcso705343b3a.2; Fri, 22 Sep 2023 08:23:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695396198; x=1696000998; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WZ743c23h82eWXrVp5Ju6MBdvRvF0AFD87bTIsRHhaE=; b=QVUFMDEDRu5qJ44up4LdUP+Yd70b3Uwqhn7jv3yqQ3BSE8LBVu0b0M42I4rcKWsCgF IIAu5Ingg4HxpRklNEykEl2klYF0BLbrlbNs4pHcvRhfzJXGqplxqtAxtFdhDlcnrl+6 1zOWy5nJPqUuOCIth24WSz+E+xg9pmbtGDoclfVNas8g0gQgDCWE5ROrEHfzW2F8mkGb AR+QiZtx6HKB6JpSJZafGPqUyAYjCp1oX6IdXggW0RWML7uhfa5+F+SRXHHzKkl8nm5/ /RLL+cCBqPUPFTloWPmQ6dv7upuuxvWWw58xDJxAezsZTajb/BE2kkCU9sbQrCWgiNbs gj5g== X-Gm-Message-State: AOJu0Yy6LUiFEGUB0lWOBcdKGFRUEiWdfjA8nOQjU9LtUCZTEOC08/Iq 5MzkpEoi9bHDT4QAC+NggW149uJ+d0g= X-Received: by 2002:a05:6a20:12c9:b0:157:7568:6796 with SMTP id v9-20020a056a2012c900b0015775686796mr8773128pzg.60.1695396197651; Fri, 22 Sep 2023 08:23:17 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:70e9:c86f:4352:fcc? ([2620:15c:211:201:70e9:c86f:4352:fcc]) by smtp.gmail.com with ESMTPSA id a13-20020a17090a8c0d00b002633fa95ac2sm5081544pjo.13.2023.09.22.08.23.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Sep 2023 08:23:17 -0700 (PDT) Message-ID: <50b20a3e-e264-4788-8e52-f7b57cf944f0@acm.org> Date: Fri, 22 Sep 2023 08:23:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] scsi: core: scsi_device_online() return false if state is SDEV_CANCEL Content-Language: en-US To: Wenchao Hao , "James E . J . Bottomley" , "Martin K . Petersen" , open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, louhongxiang@huawei.com References: <20230922093636.2645961-1-haowenchao2@huawei.com> <20230922093636.2645961-2-haowenchao2@huawei.com> From: Bart Van Assche In-Reply-To: <20230922093636.2645961-2-haowenchao2@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 08:23:34 -0700 (PDT) On 9/22/23 02:36, Wenchao Hao wrote: > SDEV_CANCEL is set when removing device and scsi_device_online() should > return false if sdev_state is SDEV_CANCEL. > > IO hang would be caused if return true when state is SDEV_CANCEL with > following order: > > T1: T2:scsi_error_handler > __scsi_remove_device() > scsi_device_set_state(sdev, SDEV_CANCEL) > scsi_eh_flush_done_q() > if (scsi_device_online(sdev)) > scsi_queue_insert(scmd,...) > > The command added by scsi_queue_insert() would never be handled any > more. Why not? I think the blk_mq_destroy_queue() call in __scsi_remove_device() will cause it to fail. Thanks, Bart.