lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f41d7aba-63ce-4c32-c01e-68d3647c7479@acm.org>
Date:   Mon, 27 Mar 2023 14:34:27 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Ye Bin <yebin@...weicloud.com>, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Ye Bin <yebin10@...wei.com>
Subject: Re: [PATCH 2/5] scsi: introduce SHOST_BLOCKED state to support
 blocking IO

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ