linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Yu Kuai <yukuai1@huaweicloud.com>, axboe@kernel.dk, hch@lst.de
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-raid@vger.kernel.org, martin.petersen@oracle.com,
	"yangerkun@huawei.com" <yangerkun@huawei.com>,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH RFC 5/6] md/raid1: Handle bio_split() errors
Date: Wed, 23 Oct 2024 12:16:19 +0100	[thread overview]
Message-ID: <0cf7985e-e7ac-4503-827b-eb2a0fd6ef67@oracle.com> (raw)
In-Reply-To: <be465913-80c7-762a-51f1-56021aa323dd@huaweicloud.com>

On 23/09/2024 10:38, Yu Kuai wrote:
>>>>>
>>>>> We need a new branch in read_balance() to choose a rdev with full 
>>>>> copy.
>>>>
>>>> Sure, I do realize that the mirror'ing personalities need more 
>>>> sophisticated error handling changes (than what I presented).
>>>>
>>>> However, in raid1_read_request() we do the read_balance() and then 
>>>> the bio_split() attempt. So what are you suggesting we do for the 
>>>> bio_split() error? Is it to retry without the bio_split()?
>>>>
>>>> To me bio_split() should not fail. If it does, it is likely ENOMEM 
>>>> or some other bug being exposed, so I am not sure that retrying with 
>>>> skipping bio_split() is the right approach (if that is what you are 
>>>> suggesting).
>>>
>>> bio_split_to_limits() is already called from md_submit_bio(), so here
>>> bio should only be splitted because of badblocks or resync. We have to
>>> return error for resync, however, for badblocks, we can still try to
>>> find a rdev without badblocks so bio_split() is not needed. And we need
>>> to retry and inform read_balance() to skip rdev with badblocks in this
>>> case.
>>>
>>> This can only happen if the full copy only exist in slow disks. This
>>> really is corner case, and this is not related to your new error path by
>>> atomic write. I don't mind this version for now, just something
>>> I noticed if bio_spilit() can fail.
>>

Hi Kuai,

I am just coming back to this topic now.

Previously I was saying that we should error and end the bio if we need 
to split for an atomic write due to BB. Continued below..

>> Are you saying that some improvement needs to be made to the current 
>> code for badblocks handling, like initially try to skip bio_split()?
>>
>> Apart from that, what about the change in raid10_write_request(), 
>> w.r.t error handling?
>>
>> There, for an error in bio_split(), I think that we need to do some 
>> tidy-up if bio_split() fails, i.e. undo increase in rdev->nr_pending 
>> when looping conf->copies
>>
>> BTW, feel free to comment in patch 6/6 for that.
> 
> Yes, raid1/raid10 write are the same. If you want to enable atomic write
> for raid1/raid10, you must add a new branch to handle badblocks now,
> otherwise, as long as one copy contain any badblocks, atomic write will
> fail while theoretically I think it can work.

Can you please expand on what you mean by this last sentence, "I think 
it can work".

Indeed, IMO, chance of encountering a device with BBs and supporting 
atomic writes is low, so no need to try to make it work (if it were 
possible) - I think that we just report EIO.

Thanks,
John


  parent reply	other threads:[~2024-10-23 11:21 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19  9:22 [PATCH RFC 0/6] bio_split() error handling rework John Garry
2024-09-19  9:22 ` [PATCH RFC 1/6] block: Rework bio_split() return value John Garry
2024-09-19 15:50   ` Johannes Thumshirn
2024-09-23  7:27     ` John Garry
2024-09-20 14:07   ` Christoph Hellwig
2024-09-19  9:22 ` [PATCH RFC 2/6] block: Error an attempt to split an atomic write in bio_split() John Garry
2024-09-19  9:22 ` [PATCH RFC 3/6] block: Handle bio_split() errors in bio_submit_split() John Garry
2024-09-20 14:09   ` Christoph Hellwig
2024-09-23 10:33     ` John Garry
2024-09-19  9:23 ` [PATCH RFC 4/6] md/raid0: Handle bio_split() errors John Garry
2024-09-20 14:10   ` Christoph Hellwig
2024-09-19  9:23 ` [PATCH RFC 5/6] md/raid1: " John Garry
2024-09-20  6:58   ` Yu Kuai
2024-09-20 10:04     ` John Garry
2024-09-23  6:15       ` Yu Kuai
2024-09-23  7:44         ` John Garry
2024-09-23  8:18           ` Yu Kuai
2024-09-23  9:21             ` John Garry
2024-09-23  9:38               ` Yu Kuai
2024-09-23 10:40                 ` John Garry
2024-10-23 11:16                 ` John Garry [this message]
2024-10-23 11:46                   ` Geoff Back
2024-10-23 12:11                     ` John Garry
2024-10-24  2:10                       ` Yu Kuai
2024-10-24  8:57                         ` John Garry
2024-10-24  9:12                           ` Yu Kuai
2024-10-24  9:56                             ` John Garry
2024-10-25  1:39                               ` Yu Kuai
2024-10-23 11:21         ` John Garry
2024-10-24  3:08           ` Yu Kuai
2024-10-24 13:51             ` John Garry
2024-10-25  1:24               ` Yu Kuai
2024-09-19  9:23 ` [PATCH RFC 6/6] md/raid10: " John Garry
2024-09-23  5:53 ` [PATCH RFC 0/6] bio_split() error handling rework Hannes Reinecke
2024-09-23  7:19   ` John Garry
2024-09-23  9:43     ` Hannes Reinecke
2024-09-23 10:21       ` John Garry

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=0cf7985e-e7ac-4503-827b-eb2a0fd6ef67@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yangerkun@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).