From: Bart Van Assche <bvanassche@acm.org>
To: Wenchao Hao <haowenchao2@huawei.com>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, louhongxiang@huawei.com
Subject: Re: [PATCH 1/2] scsi: core: scsi_device_online() return false if state is SDEV_CANCEL
Date: Fri, 22 Sep 2023 08:23:15 -0700 [thread overview]
Message-ID: <50b20a3e-e264-4788-8e52-f7b57cf944f0@acm.org> (raw)
In-Reply-To: <20230922093636.2645961-2-haowenchao2@huawei.com>
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.
next prev parent reply other threads:[~2023-09-22 15:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 9:36 [PATCH 0/2] Fix two issue between removing device and error handle Wenchao Hao
2023-09-22 9:36 ` [PATCH 1/2] scsi: core: scsi_device_online() return false if state is SDEV_CANCEL Wenchao Hao
2023-09-22 15:23 ` Bart Van Assche [this message]
2023-09-24 6:37 ` Wenchao Hao
2023-09-25 15:02 ` Wenchao Hao
2023-09-22 9:36 ` [PATCH 2/2] scsi: scsi_error: Fix device reset is not triggered Wenchao Hao
2023-09-22 15:18 ` Bart Van Assche
2023-09-24 6:57 ` Wenchao Hao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50b20a3e-e264-4788-8e52-f7b57cf944f0@acm.org \
--to=bvanassche@acm.org \
--cc=haowenchao2@huawei.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=louhongxiang@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=open-iscsi@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®