Skip to content

block: scsi: introduce and use BLK_STS_OFFLINE

Song Liu linux-block linux-scsi 2 versions Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesApplied
  2. v12 patches 9 repliesSuperseded

Changes in v2 from the cover letter

1. Add patch 2/3 to change user visible return value to -ENODEV. (Hannes)
2. In the commit log, explain the reason to keep EIO in 1/3.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3block: introduce BLK_STS_OFFLINEblock/blk-core.c include/linux/blk_types.h+8 -01 reply
2/3block: return -ENODEV for BLK_STS_OFFLINEblock/blk-core.c+1 -11 reply
3/3scsi: use BLK_STS_OFFLINE for not fully online devicesdrivers/scsi/scsi_lib.c+1 -10 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchHannes ReineckeMartin K. Petersen
SeriesR-b
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] block: scsi: introduce and use BLK_STS_OFFLINE

Changes v1 => v2:
1. Add patch 2/3 to change user visible return value to -ENODEV. (Hannes)
2. In the commit log, explain the reason to keep EIO in 1/3.

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 (3):
block: introduce BLK_STS_OFFLINE
block: return -ENODEV for 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