mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: nenkov2004@gmail.com
Cc: yukuai@fygo.io, linux-raid@vger.kernel.org, song@kernel.org,
	 dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	 magiclinan@didiglobal.com, xiao@kernel.org, neil@brown.name,
	 agk@redhat.com, snitzer@kernel.org, bmarzins@redhat.com,
	 syzbot+8b22a0459202f76b4096@syzkaller.appspotmail.com
Subject: Re: [PATCH v3] dm raid: Clear MD_RECOVERY_WAIT on reshape setup failure
Date: Mon, 30 Nov 2026 13:44:33 +0100 (CET)	[thread overview]
Message-ID: <a1585a96-b4be-ceac-af6d-692cd008aeb9@redhat.com> (raw)
In-Reply-To: <CAO7_G+xnh4AGdYNM-a7dyYh6LmRtBoSGvgo_pKiZ76cDbP2ddA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4602 bytes --]

Applied, thanks.

Mikulas


On Sun, 29 Nov 2026, nenkov2004@gmail.com wrote:

> From: Hristos Nenkov <nenkov2004@gmail.com>
> 
> rs_start_reshape() sets MD_RECOVERY_WAIT to keep the sync thread
> from running before the table reload. If setup, check_reshape() or
> start_reshape() fails, raid_preresume() logs the error and continues
> without a reshape. There is no reshape-related table reload to wait for.
> 
> Clear MD_RECOVERY_WAIT on those error paths. Keep the bit set when
> reshape setup succeeds.
> 
> Fixes: 644e2537fdc7 ("dm raid: fix stripe adding reshape deadlock")
> Suggested-by: Yu Kuai <yukuai@fygo.io>
> Link: https://lore.kernel.org/r/4d13edef-f454-437b-8910-3a905697303e@fygo.io
> Reviewed-by: Yu Kuai <yukuai@fygo.io>
> Signed-off-by: Hristos Nenkov <nenkov2004@gmail.com>
> ---
> Changes in v3:
> - Add the Fixes and Reviewed-by trailers from Yu Kuai's review.
> - Resend only the dm-raid patch. Yu Kuai has applied the RAID10 patch.
> 
>  drivers/md/dm-raid.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
> index ac019a0f5..e132951f3 100644
> --- a/drivers/md/dm-raid.c
> +++ b/drivers/md/dm-raid.c
> @@ -4004,7 +4004,7 @@ static int rs_start_reshape(struct raid_set *rs)
> 
>  	r = rs_setup_reshape(rs);
>  	if (r)
> -		return r;
> +		goto clear_recovery_wait;
> 
>  	/*
>  	 * Check any reshape constraints enforced by the personalility
> @@ -4014,7 +4014,7 @@ static int rs_start_reshape(struct raid_set *rs)
>  	r = pers->check_reshape(mddev);
>  	if (r) {
>  		rs->ti->error = "pers->check_reshape() failed";
> -		return r;
> +		goto clear_recovery_wait;
>  	}
> 
>  	/*
> @@ -4025,7 +4025,7 @@ static int rs_start_reshape(struct raid_set *rs)
>  		r = pers->start_reshape(mddev);
>  		if (r) {
>  			rs->ti->error = "pers->start_reshape() failed";
> -			return r;
> +			goto clear_recovery_wait;
>  		}
>  	}
> 
> @@ -4037,6 +4037,10 @@ static int rs_start_reshape(struct raid_set *rs)
>  	rs_update_sbs(rs);
> 
>  	return 0;
> +
> +clear_recovery_wait:
> +	clear_bit(MD_RECOVERY_WAIT, &mddev->recovery);
> +	return r;
>  }
> 
>  static int raid_preresume(struct dm_target *ti)
> 
> 
> On Sun, 29 Nov 2026 15:15:54 +0800, yu kuai <yukuai@fygo.io> wrote:
> > 在 2026/11/20 19:17, nenkov2004@gmail.com 写道:
> >
> > > From: Hristos Nenkov <nenkov2004@gmail.com>
> > >
> > > rs_start_reshape() sets MD_RECOVERY_WAIT to keep the sync thread
> > > from running before the table reload. If setup, check_reshape() or
> > > start_reshape() fails, raid_preresume() logs the error and continues
> > > without a reshape. There is no reshape-related table reload to wait for.
> > >
> > > Clear MD_RECOVERY_WAIT on those error paths. Keep the bit set when
> > > reshape setup succeeds.
> > >
> > > Suggested-by: Yu Kuai <yukuai@fygo.io>
> > > Link: https://lore.kernel.org/r/4d13edef-f454-437b-8910-3a905697303e@fygo.io
> > > Signed-off-by: Hristos Nenkov <nenkov2004@gmail.com>
> >
> > With following tag:
> > Fixes: 644e2537fdc7 ("dm raid: fix stripe adding reshape deadlock")
> >
> > Reviewed-by: Yu Kuai <yukuai@fygo.io>
> >
> > > ---
> > >   drivers/md/dm-raid.c | 10 +++++++---
> > >   1 file changed, 7 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
> > > index ac019a0f5..e132951f3 100644
> > > --- a/drivers/md/dm-raid.c
> > > +++ b/drivers/md/dm-raid.c
> > > @@ -4004,7 +4004,7 @@ static int rs_start_reshape(struct raid_set *rs)
> > >
> > >   	r = rs_setup_reshape(rs);
> > >   	if (r)
> > > -		return r;
> > > +		goto clear_recovery_wait;
> > >
> > >   	/*
> > >   	 * Check any reshape constraints enforced by the personalility
> > > @@ -4014,7 +4014,7 @@ static int rs_start_reshape(struct raid_set *rs)
> > >   	r = pers->check_reshape(mddev);
> > >   	if (r) {
> > >   		rs->ti->error = "pers->check_reshape() failed";
> > > -		return r;
> > > +		goto clear_recovery_wait;
> > >   	}
> > >
> > >   	/*
> > > @@ -4025,7 +4025,7 @@ static int rs_start_reshape(struct raid_set *rs)
> > >   		r = pers->start_reshape(mddev);
> > >   		if (r) {
> > >   			rs->ti->error = "pers->start_reshape() failed";
> > > -			return r;
> > > +			goto clear_recovery_wait;
> > >   		}
> > >   	}
> > >
> > > @@ -4037,6 +4037,10 @@ static int rs_start_reshape(struct raid_set *rs)
> > >   	rs_update_sbs(rs);
> > >
> > >   	return 0;
> > > +
> > > +clear_recovery_wait:
> > > +	clear_bit(MD_RECOVERY_WAIT, &mddev->recovery);
> > > +	return r;
> > >   }
> > >
> > >   static int raid_preresume(struct dm_target *ti)
> >
> > --
> > Thanks,
> > Kuai
> 

  reply	other threads:[~2026-11-30 12:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 11:23 [syzbot] [dm?] WARNING in raid_resume syzbot
2026-11-10  5:44 ` [PATCH] md/raid10: preserve recovery flags on reshape abort Hristos Nenkov
2026-11-20  7:05   ` yu kuai
2026-11-20 11:17     ` [PATCH v2 0/2] Fix recovery flags on failed RAID10 reshape nenkov2004
2026-11-20 11:17       ` [PATCH v2 1/2] dm raid: Clear MD_RECOVERY_WAIT on reshape setup failure nenkov2004
2026-11-29  7:15         ` yu kuai
2026-11-29 15:37           ` [PATCH v3] " nenkov2004
2026-11-30 12:44             ` Mikulas Patocka [this message]
2026-11-20 11:17       ` [PATCH v2 2/2] md/raid10: Preserve recovery flags on reshape abort nenkov2004
2026-11-29  7:36         ` yu kuai

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=a1585a96-b4be-ceac-af6d-692cd008aeb9@redhat.com \
    --to=mpatocka@redhat.com \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=magiclinan@didiglobal.com \
    --cc=neil@brown.name \
    --cc=nenkov2004@gmail.com \
    --cc=snitzer@kernel.org \
    --cc=song@kernel.org \
    --cc=syzbot+8b22a0459202f76b4096@syzkaller.appspotmail.com \
    --cc=xiao@kernel.org \
    --cc=yukuai@fygo.io \
    /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

all inboxes | Powered by JetHome®