[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68d10e83-b196-4935-a350-464b82c30e44@oracle.com>
Date: Wed, 23 Oct 2024 12:21:00 +0100
From: John Garry <john.g.garry@...cle.com>
To: Yu Kuai <yukuai1@...weicloud.com>, axboe@...nel.dk, hch@....de
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-raid@...r.kernel.org, martin.petersen@...cle.com,
"yangerkun@...wei.com" <yangerkun@...wei.com>,
"yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH RFC 5/6] md/raid1: Handle bio_split() errors
On 23/09/2024 07:15, Yu Kuai wrote:
Hi Kuai,
>> iff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
>> index 6c9d24203f39..c561e2d185e2 100644
>> --- a/drivers/md/raid1.c
>> +++ b/drivers/md/raid1.c
>> @@ -1383,6 +1383,10 @@ static void raid1_read_request(struct mddev
>> *mddev, struct bio *bio,
>> if (max_sectors < bio_sectors(bio)) {
>> struct bio *split = bio_split(bio, max_sectors,
>> gfp, &conf->bio_split);
>> + if (IS_ERR(split)) {
>> + raid_end_bio_io(r1_bio);
>> + return;
>> + }
>
> This way, BLK_STS_IOERR will always be returned, perhaps what you want
> is to return the error code from bio_split()?
I am not sure on the best way to pass the bio_split() error code to
bio->bi_status.
I could just have this pattern:
bio->bi_status = errno_to_blk_status(err);
set_bit(R1BIO_Uptodate, &r1_bio->state);
raid_end_bio_io(r1_bio);
Is there a neater way to do this?
Thanks,
John
Powered by blists - more mailing lists