[PATCH v2 0/7] md: enhance faulty checking for blocked handling

Yu Kuai posted 7 patches 1 month, 2 weeks ago
drivers/md/md.c     | 15 +++++++--
drivers/md/md.h     | 24 +++++++++++++++
drivers/md/raid1.c  | 75 +++++++++++++++++++++++----------------------
drivers/md/raid10.c | 40 +++++++++++-------------
drivers/md/raid5.c  | 13 ++++----
5 files changed, 99 insertions(+), 68 deletions(-)
[PATCH v2 0/7] md: enhance faulty checking for blocked handling
Posted by Yu Kuai 1 month, 2 weeks ago
From: Yu Kuai <yukuai3@huawei.com>

Changes in v2:
 - add more comments and commit message in patch 3;
 - fix some typo;

The lifetime of badblocks:

1) IO error, and decide to record badblocks, and record sb_flags;
2) write IO found rdev has badblocks and not yet acknowledged, then this
IO is blocked;
3) daemon found sb_flags is set, update superblock and flush badblocks;
4) write IO continue;

Main idea is that badblocks will be set in memory fist, before badblocks
are acknowledged, new write request must be blocked to prevent reading
old data after power failure, and this behaviour is not necessary if rdev
is faulty in the first place.

Yu Kuai (7):
  md: add a new helper rdev_blocked()
  md: don't wait faulty rdev in md_wait_for_blocked_rdev()
  md: don't record new badblocks for faulty rdev
  md/raid1: factor out helper to handle blocked rdev from
    raid1_write_request()
  md/raid1: don't wait for Faulty rdev in wait_blocked_rdev()
  md/raid10: don't wait for Faulty rdev in wait_blocked_rdev()
  md/raid5: don't set Faulty rdev for blocked_rdev

 drivers/md/md.c     | 15 +++++++--
 drivers/md/md.h     | 24 +++++++++++++++
 drivers/md/raid1.c  | 75 +++++++++++++++++++++++----------------------
 drivers/md/raid10.c | 40 +++++++++++-------------
 drivers/md/raid5.c  | 13 ++++----
 5 files changed, 99 insertions(+), 68 deletions(-)

-- 
2.39.2
Re: [PATCH v2 0/7] md: enhance faulty checking for blocked handling
Posted by Song Liu 1 month, 1 week ago
Mariusz, you have run some tests on v1, but didn't give your
Tested-by tag. Would you mind rerun the test and reply with
the tag?

Thanks,
Song

On Thu, Oct 10, 2024 at 6:18 PM Yu Kuai <yukuai1@huaweicloud.com> wrote:
>
> From: Yu Kuai <yukuai3@huawei.com>
>
> Changes in v2:
>  - add more comments and commit message in patch 3;
>  - fix some typo;
>
> The lifetime of badblocks:
>
> 1) IO error, and decide to record badblocks, and record sb_flags;
> 2) write IO found rdev has badblocks and not yet acknowledged, then this
> IO is blocked;
> 3) daemon found sb_flags is set, update superblock and flush badblocks;
> 4) write IO continue;
>
> Main idea is that badblocks will be set in memory fist, before badblocks
> are acknowledged, new write request must be blocked to prevent reading
> old data after power failure, and this behaviour is not necessary if rdev
> is faulty in the first place.
>
> Yu Kuai (7):
>   md: add a new helper rdev_blocked()
>   md: don't wait faulty rdev in md_wait_for_blocked_rdev()
>   md: don't record new badblocks for faulty rdev
>   md/raid1: factor out helper to handle blocked rdev from
>     raid1_write_request()
>   md/raid1: don't wait for Faulty rdev in wait_blocked_rdev()
>   md/raid10: don't wait for Faulty rdev in wait_blocked_rdev()
>   md/raid5: don't set Faulty rdev for blocked_rdev
>
>  drivers/md/md.c     | 15 +++++++--
>  drivers/md/md.h     | 24 +++++++++++++++
>  drivers/md/raid1.c  | 75 +++++++++++++++++++++++----------------------
>  drivers/md/raid10.c | 40 +++++++++++-------------
>  drivers/md/raid5.c  | 13 ++++----
>  5 files changed, 99 insertions(+), 68 deletions(-)
>
> --
> 2.39.2
>
Re: [PATCH v2 0/7] md: enhance faulty checking for blocked handling
Posted by Mariusz Tkaczyk 1 month, 1 week ago
On Thu, 17 Oct 2024 23:46:58 -0700
Song Liu <song@kernel.org> wrote:

> Mariusz, you have run some tests on v1, but didn't give your
> Tested-by tag. Would you mind rerun the test and reply with
> the tag?
> 
> Thanks,
> Song

Hi Song,
I see no functional difference between v1 and v2 feel free to add it.
I will be hard to rerun these tests right now.

Tested-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>

Thanks,
Mariusz
Re: [PATCH v2 0/7] md: enhance faulty checking for blocked handling
Posted by Song Liu 1 month, 1 week ago
On Fri, Oct 18, 2024 at 5:56 AM Mariusz Tkaczyk
<mariusz.tkaczyk@linux.intel.com> wrote:
>
> On Thu, 17 Oct 2024 23:46:58 -0700
> Song Liu <song@kernel.org> wrote:
>
> > Mariusz, you have run some tests on v1, but didn't give your
> > Tested-by tag. Would you mind rerun the test and reply with
> > the tag?
> >
> > Thanks,
> > Song
>
> Hi Song,
> I see no functional difference between v1 and v2 feel free to add it.
> I will be hard to rerun these tests right now.
>
> Tested-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>

Applied to md-6.13 branch.

Thanks,
Song