[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e6ad350-24df-7003-6837-9796e83f8fac@huaweicloud.com>
Date: Tue, 29 Oct 2024 11:52:48 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: John Garry <john.g.garry@...cle.com>, axboe@...nel.dk, song@...nel.org,
hch@....de
Cc: martin.petersen@...cle.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org, hare@...e.de,
Johannes.Thumshirn@....com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v2 5/7] md/raid0: Handle bio_split() errors
在 2024/10/28 23:27, John Garry 写道:
> Add proper bio_split() error handling. For any error, set bi_status, end
> the bio, and return.
>
> Signed-off-by: John Garry <john.g.garry@...cle.com>
> ---
> drivers/md/raid0.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
LGTM
Reviewed-by: Yu Kuai <yukuai3@...wei.com>
> diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
> index 32d587524778..baaf5f8b80ae 100644
> --- a/drivers/md/raid0.c
> +++ b/drivers/md/raid0.c
> @@ -466,6 +466,12 @@ static void raid0_handle_discard(struct mddev *mddev, struct bio *bio)
> struct bio *split = bio_split(bio,
> zone->zone_end - bio->bi_iter.bi_sector, GFP_NOIO,
> &mddev->bio_set);
> +
> + if (IS_ERR(split)) {
> + bio->bi_status = errno_to_blk_status(PTR_ERR(split));
> + bio_endio(bio);
> + return;
> + }
> bio_chain(split, bio);
> submit_bio_noacct(bio);
> bio = split;
> @@ -608,6 +614,12 @@ static bool raid0_make_request(struct mddev *mddev, struct bio *bio)
> if (sectors < bio_sectors(bio)) {
> struct bio *split = bio_split(bio, sectors, GFP_NOIO,
> &mddev->bio_set);
> +
> + if (IS_ERR(split)) {
> + bio->bi_status = errno_to_blk_status(PTR_ERR(split));
> + bio_endio(bio);
> + return true;
> + }
> bio_chain(split, bio);
> raid0_map_submit_bio(mddev, bio);
> bio = split;
>
Powered by blists - more mailing lists