public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: btrfs_log_dev_io_error() on all bio errors
@ 2026-03-13 19:26 Boris Burkov
  2026-03-13 21:18 ` Qu Wenruo
  2026-03-16 16:20 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Boris Burkov @ 2026-03-13 19:26 UTC (permalink / raw)
  To: linux-btrfs, kernel-team; +Cc: hch

As far as I can tell, we never intentionally constrained ourselves to
these status codes, and it is misleading and surprising to lack the
bdev error logging when we get a different error code from the block
layer. This can lead to jumping to a wrong conclusion like "this
system didn't see any bio failures but aborted with EIO".

For example on nvme devices, I observe many failures coming back as
BLK_STS_MEDIUM. It is apparent that the nvme driver returns a variety of
BLK_STS_* status values in nvme_error_status().

Signed-off-by: Boris Burkov <boris@bur.io>
---
 fs/btrfs/bio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c
index 2a2a21aec817..08b1d62603d0 100644
--- a/fs/btrfs/bio.c
+++ b/fs/btrfs/bio.c
@@ -352,8 +352,7 @@ static void btrfs_log_dev_io_error(const struct bio *bio, struct btrfs_device *d
 {
 	if (!dev || !dev->bdev)
 		return;
-	if (bio->bi_status != BLK_STS_IOERR && bio->bi_status != BLK_STS_TARGET)
-		return;
+	ASSERT(bio->bi_status);
 
 	if (btrfs_op(bio) == BTRFS_MAP_WRITE)
 		btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-17 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13 19:26 [PATCH] btrfs: btrfs_log_dev_io_error() on all bio errors Boris Burkov
2026-03-13 21:18 ` Qu Wenruo
2026-03-16 16:20 ` Christoph Hellwig
2026-03-16 16:29   ` Boris Burkov
2026-03-17 13:59     ` Christoph Hellwig
2026-03-17 16:16       ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox