[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251221025233.87087-9-agruenba@redhat.com>
Date: Sun, 21 Dec 2025 03:52:23 +0100
From: Andreas Gruenbacher <agruenba@...hat.com>
To: Christoph Hellwig <hch@...radead.org>,
Jens Axboe <axboe@...nel.dk>,
Chris Mason <clm@...com>,
David Sterba <dsterba@...e.com>,
Satya Tangirala <satyat@...gle.com>
Cc: Andreas Gruenbacher <agruenba@...hat.com>,
linux-block@...r.kernel.org,
linux-btrfs@...r.kernel.org,
linux-raid@...r.kernel.org,
dm-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [RFC v2 08/17] block: fix blk_status_to_{errno,str} inconsistency
Change blk_status_to_str() to be consistent with blk_status_to_errno()
and return "I/O" for undefined status codes.
With that, the fallback case in blk_errors can be removed with no change
in behavior.
Signed-off-by: Andreas Gruenbacher <agruenba@...hat.com>
---
block/blk-core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 4f7b7cf50d23..47ce458b4f34 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -161,9 +161,6 @@ static const struct {
[BLK_STS_DURATION_LIMIT] = { -ETIME, "duration limit exceeded" },
[BLK_STS_INVAL] = { -EINVAL, "invalid" },
-
- /* everything else not covered above: */
- [BLK_STS_IOERR] = { -EIO, "I/O" },
};
blk_status_t errno_to_blk_status(int errno)
@@ -194,7 +191,7 @@ const char *blk_status_to_str(blk_status_t status)
int idx = (__force int)status;
if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors)))
- return "<null>";
+ return "I/O";
return blk_errors[idx].name;
}
EXPORT_SYMBOL_GPL(blk_status_to_str);
--
2.52.0
Powered by blists - more mailing lists