mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 824731276@qq.com
To: axboe@kernel.dk
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	baiguo@kylinos.cn
Subject: [PATCH] block:added printing when bio->bi_status fails
Date: Wed,  7 Aug 2024 17:33:58 +0800	[thread overview]
Message-ID: <tencent_F71A15579D1E52ED0B58EF2F3607AA883308@qq.com> (raw)

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


             reply	other threads:[~2024-08-07  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07  9:33 824731276 [this message]
2024-08-07 19:55 ` kernel test robot
2024-08-07 20:05 ` kernel test robot
2024-08-08  9:54 824731276
2024-08-16  4:04 ` kernel test robot
2024-08-16  7:45 ` Yu Kuai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_F71A15579D1E52ED0B58EF2F3607AA883308@qq.com \
    --to=824731276@qq.com \
    --cc=axboe@kernel.dk \
    --cc=baiguo@kylinos.cn \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®