[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <01a0fa06-fa8e-81f8-b93f-f4a81b4dc6e0@huaweicloud.com>
Date: Fri, 16 Aug 2024 15:45:39 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: 824731276@...com, axboe@...nel.dk
Cc: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
baiguo@...inos.cn, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH] block:added printing when bio->bi_status fails
Hi,
在 2024/08/08 17:54, 824731276@...com 写道:
> From: baiguo <baiguo@...inos.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@...inos.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);
I don't understand why you'll need this, bio_endio() will still be
called for unsupported bio from submit_bio_noacct() when the disk is
fine.
For real disks blk_print_req_error() already print message for failed IO
that are submitted to disk.
Thanks,
Kuai
> +
> /*
> * Need to have a real endio function for chained bios, otherwise
> * various corner cases will break (like stacking block devices that
>
Powered by blists - more mailing lists