mbox series

[0/2] block: scsi: introduce and use BLK_STS_OFFLINE

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

Message

Song Liu Feb. 3, 2022, 6:40 a.m. UTC
We have a use case where HDDs are regularly power on/off to perserve power.
When a drive is being removed, we often see errors like

   [  172.803279] I/O error, dev sda, sector 3137184

These messages are confusing for automations that grep dmesg, as they look
very similar to real HDD error.

Solve this issue with a new block state BLK_STS_OFFLINE. After the change,
the error message looks like

   [  172.803279] device offline error, dev sda, sector 3137184

so that the automations won't confuse them with real I/O error.

Song Liu (2):
  block: introduce BLK_STS_OFFLINE
  scsi: use BLK_STS_OFFLINE for not fully online devices

 block/blk-core.c          | 1 +
 drivers/scsi/scsi_lib.c   | 2 +-
 include/linux/blk_types.h | 7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

--
2.30.2

Comments

Song Liu Feb. 3, 2022, 6:52 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:
>
> We have a use case where HDDs are regularly power on/off to perserve power.
> When a drive is being removed, we often see errors like
>
>    [  172.803279] I/O error, dev sda, sector 3137184
>
> These messages are confusing for automations that grep dmesg, as they look
> very similar to real HDD error.
>
> Solve this issue with a new block state BLK_STS_OFFLINE. After the change,
> the error message looks like
>
>    [  172.803279] device offline error, dev sda, sector 3137184
>
> so that the automations won't confuse them with real I/O error.
>
> Song Liu (2):
>   block: introduce BLK_STS_OFFLINE
>   scsi: use BLK_STS_OFFLINE for not fully online devices
>
>  block/blk-core.c          | 1 +
>  drivers/scsi/scsi_lib.c   | 2 +-
>  include/linux/blk_types.h | 7 +++++++
>  3 files changed, 9 insertions(+), 1 deletion(-)
>
> --
> 2.30.2