From: Bart Van Assche <bvanassche@acm.org>
To: Ye Bin <yebin@huaweicloud.com>,
jejb@linux.ibm.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Ye Bin <yebin10@huawei.com>
Subject: Re: [PATCH 2/5] scsi: introduce SHOST_BLOCKED state to support blocking IO
Date: Mon, 27 Mar 2023 14:34:27 -0700 [thread overview]
Message-ID: <f41d7aba-63ce-4c32-c01e-68d3647c7479@acm.org> (raw)
In-Reply-To: <20230325011734.507453-3-yebin@huaweicloud.com>
On 3/24/23 18:17, Ye Bin wrote:
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index 9b6fbbe15d92..3b497fd4d329 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -90,6 +90,7 @@ int scsi_host_set_state(struct Scsi_Host *shost, enum scsi_host_state state)
> switch (oldstate) {
> case SHOST_CREATED:
> case SHOST_RECOVERY:
> + case SHOST_BLOCKED:
> break;
> default:
> goto illegal;
> @@ -99,6 +100,7 @@ int scsi_host_set_state(struct Scsi_Host *shost, enum scsi_host_state state)
> case SHOST_RECOVERY:
> switch (oldstate) {
> case SHOST_RUNNING:
> + case SHOST_BLOCKED:
> break;
> default:
> goto illegal;
> @@ -109,6 +111,7 @@ int scsi_host_set_state(struct Scsi_Host *shost, enum scsi_host_state state)
> switch (oldstate) {
> case SHOST_CREATED:
> case SHOST_RUNNING:
> + case SHOST_BLOCKED:
> case SHOST_CANCEL_RECOVERY:
> break;
> default:
> @@ -144,6 +147,14 @@ int scsi_host_set_state(struct Scsi_Host *shost, enum scsi_host_state state)
> goto illegal;
> }
> break;
> + case SHOST_BLOCKED:
> + switch (oldstate) {
> + case SHOST_RUNNING:
> + break;
> + default:
> + goto illegal;
> + }
> + break;
> }
If a host is blocked, error recovery happens and completes, the host
will be unblocked. I don't think that is acceptable.
The "blocked" property is orthogonal to the host state so a new boolean
member variable should be introduced in struct Scsi_Host instead of
introducing a new SCSI host state.
Thanks,
Bart.
next prev parent reply other threads:[~2023-03-27 21:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-25 1:17 [PATCH 0/5] limit set the host state by sysfs Ye Bin
2023-03-25 1:17 ` [PATCH 1/5] scsi: fix switch host state race between by sysfs and others Ye Bin
2023-03-27 21:26 ` Bart Van Assche
2023-03-25 1:17 ` [PATCH 2/5] scsi: introduce SHOST_BLOCKED state to support blocking IO Ye Bin
2023-03-27 21:34 ` Bart Van Assche [this message]
2023-03-25 1:17 ` [PATCH 3/5] scsi: limit to set the host state Ye Bin
2023-03-27 21:25 ` Bart Van Assche
2023-03-25 1:17 ` [PATCH 4/5] scsi: blocking IO when host is blocked Ye Bin
2023-03-27 21:37 ` Bart Van Assche
2023-03-25 1:17 ` [PATCH 5/5] scsi: run queue after set host state from blocked to running Ye Bin
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=f41d7aba-63ce-4c32-c01e-68d3647c7479@acm.org \
--to=bvanassche@acm.org \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=yebin10@huawei.com \
--cc=yebin@huaweicloud.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