[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPhsuW4ieXOC2YZoN6T-0spiX9iijKkHqThDf3hUY0NZ8oUHrw@mail.gmail.com>
Date: Tue, 29 Oct 2024 23:28:29 -0700
From: Song Liu <song@...nel.org>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: mariusz.tkaczyk@...el.com, linux-raid@...r.kernel.org,
linux-kernel@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com,
"yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v2 2/7] md: don't wait faulty rdev in md_wait_for_blocked_rdev()
On Tue, Oct 29, 2024 at 6:22 PM Yu Kuai <yukuai1@...weicloud.com> wrote:
>
> Hi,
>
> 在 2024/10/11 9:16, Yu Kuai 写道:
> > From: Yu Kuai <yukuai3@...wei.com>
> >
> > md_wait_for_blocked_rdev() is called for write IO while rdev is
> > blocked, howerver, rdev can be faulty after choosing this rdev to write,
> > and faulty rdev should never be accessed anymore, hence there is no point
> > to wait for faulty rdev to be unblocked.
> >
> > Signed-off-by: Yu Kuai <yukuai3@...wei.com>
> > ---
> > drivers/md/md.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/md/md.c b/drivers/md/md.c
> > index 179ee4afe937..37d1469bfc82 100644
> > --- a/drivers/md/md.c
> > +++ b/drivers/md/md.c
> > @@ -9762,9 +9762,7 @@ EXPORT_SYMBOL(md_reap_sync_thread);
> > void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev)
> > {
> > sysfs_notify_dirent_safe(rdev->sysfs_state);
> > - wait_event_timeout(rdev->blocked_wait,
> > - !test_bit(Blocked, &rdev->flags) &&
> > - !test_bit(BlockedBadBlocks, &rdev->flags),
> > + wait_event_timeout(rdev->blocked_wait, rdev_blocked(rdev),
>
> Just found that there is a stupid mistake that I should use:
>
> !rdev_blocked(rdev)
>
> Tests can't find this mistake because wait_event_timeout() is used,
> and caller will break out if rdev is unblocked.
>
> Song, since this is still is md-6.13. Do you want to to send a fix, or
> update this version?
Please send a fixed version (the whole set). I will update the branch.
Thanks,
Song
Powered by blists - more mailing lists