diff mbox series

[2/2] scsi: use BLK_STS_OFFLINE for not fully online devices

Message ID 20220203064009.1795344-3-song@kernel.org (mailing list archive)
State Superseded
Headers show
Series block: scsi: introduce and use BLK_STS_OFFLINE | expand

Commit Message

Song Liu Feb. 3, 2022, 6:40 a.m. UTC
The new error message for such case looks like

[  172.809565] device offline error, dev sda, sector 3138208 ...

which will not be confused with regular I/O error (BLK_STS_IOERR).

Signed-off-by: Song Liu <song@kernel.org>
---
 drivers/scsi/scsi_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Song Liu Feb. 3, 2022, 6:53 a.m. UTC | #1
CC linux-block (it was a typo in the original email)

On Wed, Feb 2, 2022 at 10:40 PM Song Liu <song@kernel.org> wrote:
>
> The new error message for such case looks like
>
> [  172.809565] device offline error, dev sda, sector 3138208 ...
>
> which will not be confused with regular I/O error (BLK_STS_IOERR).
>
> Signed-off-by: Song Liu <song@kernel.org>
> ---
>  drivers/scsi/scsi_lib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 0a70aa763a96..e30bc51578e9 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1276,7 +1276,7 @@ scsi_device_state_check(struct scsi_device *sdev, struct request *req)
>                  * power management commands.
>                  */
>                 if (req && !(req->rq_flags & RQF_PM))
> -                       return BLK_STS_IOERR;
> +                       return BLK_STS_OFFLINE;
>                 return BLK_STS_OK;
>         }
>  }
> --
> 2.30.2
>
Hannes Reinecke Feb. 3, 2022, 7:24 a.m. UTC | #2
On 2/3/22 07:53, Song Liu wrote:
> CC linux-block (it was a typo in the original email)
> 
> On Wed, Feb 2, 2022 at 10:40 PM Song Liu <song@kernel.org> wrote:
>>
>> The new error message for such case looks like
>>
>> [  172.809565] device offline error, dev sda, sector 3138208 ...
>>
>> which will not be confused with regular I/O error (BLK_STS_IOERR).
>>
>> Signed-off-by: Song Liu <song@kernel.org>
>> ---
>>   drivers/scsi/scsi_lib.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
>> index 0a70aa763a96..e30bc51578e9 100644
>> --- a/drivers/scsi/scsi_lib.c
>> +++ b/drivers/scsi/scsi_lib.c
>> @@ -1276,7 +1276,7 @@ scsi_device_state_check(struct scsi_device *sdev, struct request *req)
>>                   * power management commands.
>>                   */
>>                  if (req && !(req->rq_flags & RQF_PM))
>> -                       return BLK_STS_IOERR;
>> +                       return BLK_STS_OFFLINE;
>>                  return BLK_STS_OK;
>>          }
>>   }
>> --
>> 2.30.2
>>
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 0a70aa763a96..e30bc51578e9 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1276,7 +1276,7 @@  scsi_device_state_check(struct scsi_device *sdev, struct request *req)
 		 * power management commands.
 		 */
 		if (req && !(req->rq_flags & RQF_PM))
-			return BLK_STS_IOERR;
+			return BLK_STS_OFFLINE;
 		return BLK_STS_OK;
 	}
 }