diff options
author | 2022-02-03 11:28:25 -0800 | |
---|---|---|
committer | 2022-02-03 21:10:00 -0700 | |
commit | 2651bf680bc2ad9a078b7222b0873145ab4ece07 (patch) | |
tree | bf28c532359259735917a29c047f7b00c80c9097 /include/linux/blk_types.h | |
parent | fs/ntfs3: remove unnecessary NULL check (diff) | |
download | linux-2651bf680bc2ad9a078b7222b0873145ab4ece07.tar.gz linux-2651bf680bc2ad9a078b7222b0873145ab4ece07.tar.bz2 linux-2651bf680bc2ad9a078b7222b0873145ab4ece07.zip |
block: introduce BLK_STS_OFFLINE
Currently, drivers reports BLK_STS_IOERR for devices that are not full
online or being removed. This behavior could cause confusion for users,
as they are not really I/O errors from the device.
Solve this issue with a new state BLK_STS_OFFLINE, which reports "device
offline error" in dmesg instead of "I/O error".
EIO is intentionally kept to not change user visible return value.
Signed-off-by: Song Liu <song@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220203192827.1370270-2-song@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blk_types.h')
-rw-r--r-- | include/linux/blk_types.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index fe065c394fff..5561e58d158a 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -153,6 +153,13 @@ typedef u8 __bitwise blk_status_t; */ #define BLK_STS_ZONE_ACTIVE_RESOURCE ((__force blk_status_t)16) +/* + * BLK_STS_OFFLINE is returned from the driver when the target device is offline + * or is being taken offline. This could help differentiate the case where a + * device is intentionally being shut down from a real I/O error. + */ +#define BLK_STS_OFFLINE ((__force blk_status_t)17) + /** * blk_path_error - returns true if error may be path related * @error: status the request was completed with |