All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block:added printing when bio->bi_status fails
@ 2024-08-08  9:54 824731276
  2024-08-16  4:04 ` kernel test robot
  2024-08-16  7:45 ` Yu Kuai
  0 siblings, 2 replies; 6+ messages in thread
From: 824731276 @ 2024-08-08  9:54 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel, linux-block, baiguo

From: baiguo <baiguo@kylinos.cn>

    When ftrace is not enabled and bio is not OK,
    the system cannot actively record which disk is abnormal.
    Add a message record to bio_endio.

Signed-off-by: baiguo <baiguo@kylinos.cn>
---
 block/bio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/block/bio.c b/block/bio.c
index c4053d496..fb07589c8 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1617,6 +1617,11 @@ void bio_endio(struct bio *bio)
 		bio_clear_flag(bio, BIO_TRACE_COMPLETION);
 	}
 
+	if (bio->bi_status && bio->bi_bdev)
+		printk(KERN_ERR "bio: %s status is %d, disk[%d:%d]\n",\
+				__func__, bio->bi_status, bio->bi_bdev->bd_disk->major,\
+				bio->bi_bdev->bd_disk->first_minor);
+
 	/*
 	 * Need to have a real endio function for chained bios, otherwise
 	 * various corner cases will break (like stacking block devices that
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] block:added printing when bio->bi_status fails
@ 2024-08-07  9:33 824731276
  2024-08-07 19:55 ` kernel test robot
  2024-08-07 20:05 ` kernel test robot
  0 siblings, 2 replies; 6+ messages in thread
From: 824731276 @ 2024-08-07  9:33 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel, linux-block, baiguo

From: baiguo <baiguo@kylinos.cn>

When ftrace is not enabled and bio is not OK,
the system cannot actively record which disk is abnormal.
Add a message record to bio_endio.

Signed-off-by: baiguo <baiguo@kylinos.cn>
---
 block/bio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/block/bio.c b/block/bio.c
index c4053d496..29ae86c21 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1617,6 +1617,11 @@ void bio_endio(struct bio *bio)
 		bio_clear_flag(bio, BIO_TRACE_COMPLETION);
 	}
 
+	if (bio->bi_status && bio->bi_disk)
+		printk(KERN_ERR "bio: %s status is %d, disk[%d:%d]\n",\
+				__func__, bio->bi_status, bio->bi_disk->major,\
+				bio->bi_disk->first_minor);
+
 	/*
 	 * Need to have a real endio function for chained bios, otherwise
 	 * various corner cases will break (like stacking block devices that
-- 
2.33.0


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

end of thread, other threads:[~2024-08-16  7:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-08  9:54 [PATCH] block:added printing when bio->bi_status fails 824731276
2024-08-16  4:04 ` kernel test robot
2024-08-16  7:45 ` Yu Kuai
  -- strict thread matches above, loose matches on Subject: below --
2024-08-07  9:33 824731276
2024-08-07 19:55 ` kernel test robot
2024-08-07 20:05 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.