All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Xiao Ni <xni@redhat.com>
Cc: linux-raid <linux-raid@vger.kernel.org>,
	Nigel Croxon <ncroxon@redhat.com>
Subject: Re: [PATCH 04/10] mdadm/Grow: sleep a while after removing disk in impose_level
Date: Tue, 3 Sep 2024 09:22:14 +0200	[thread overview]
Message-ID: <20240903092214.00000d1d@linux.intel.com> (raw)
In-Reply-To: <CALTww29ApVRidDFfgM7N-yM0NqBa2_X5yu3uWPTAZ1aGe_QHNg@mail.gmail.com>

On Tue, 3 Sep 2024 08:53:42 +0800
Xiao Ni <xni@redhat.com> wrote:

> On Mon, Sep 2, 2024 at 6:14 PM Mariusz Tkaczyk
> <mariusz.tkaczyk@linux.intel.com> wrote:
> >
> > On Wed, 28 Aug 2024 10:11:44 +0800
> > Xiao Ni <xni@redhat.com> wrote:
> >  
> > > It needs to remove disks when reshaping from raid456 to raid0. In
> > > kernel space it sets MD_RECOVERY_RUNNING. And it will fail to change
> > > level. So wait sometime to let md thread to clear this flag.
> > >
> > > This is found by test case 05r6tor0.
> > >
> > > Signed-off-by: Xiao Ni <xni@redhat.com>
> > > ---
> > >  Grow.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/Grow.c b/Grow.c
> > > index 2a7587315817..aaf349e9722f 100644
> > > --- a/Grow.c
> > > +++ b/Grow.c
> > > @@ -3028,6 +3028,12 @@ static int impose_level(int fd, int level, char
> > > *devname, int verbose) makedev(disk.major, disk.minor));
> > >                       hot_remove_disk(fd, makedev(disk.major, disk.minor),
> > > 1); }
> > > +             /*
> > > +              * hot_remove_disk lets kernel set MD_RECOVERY_RUNNING
> > > +              * and it can't set level. It needs to wait sometime
> > > +              * to let md thread to clear the flag.
> > > +              */
> > > +             sleep_for(5, 0, true);  
> >  
> 
> Hi Mariusz
> 
> > Shouldn't we check sysfs is shorter intervals? I know that is the simplest
> > way but big sleeps are generally not good.
> >
> > I will merge it if you don't want to rework it but you need to add log that
> > we are waiting 5 second for the user to not panic that it is frozen.  
> 
> Which sysfs do you mean? If we have a better way, I want to choose it.
> 

If we are sending hot remove to the disk, we can check if there is path
available: /sys/block/<mddev>/md/dev-{devnm}
if not, then device has been finally removed.
Eventually, we can see same in mdstat but checking path looks simpler to me.

Thanks,
Mariusz

  reply	other threads:[~2024-09-03  7:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  2:11 [PATCH 00/10] mdadm tests fix Xiao Ni
2024-08-28  2:11 ` [PATCH 01/10] mdadm/Grow: Update new level when starting reshape Xiao Ni
2024-09-02  9:50   ` Mariusz Tkaczyk
2024-09-02 10:10     ` Mariusz Tkaczyk
2024-09-03  0:34       ` Xiao Ni
2024-09-03  7:34         ` Mariusz Tkaczyk
2024-09-03 10:11           ` Xiao Ni
2024-09-03  0:32     ` Xiao Ni
2024-08-28  2:11 ` [PATCH 02/10] mdadm/Grow: Update reshape_progress to need_back after reshape finishes Xiao Ni
2024-09-02  9:55   ` Mariusz Tkaczyk
2024-08-28  2:11 ` [PATCH 03/10] mdadm/Grow: Can't open raid when running --grow --continue Xiao Ni
2024-09-02 10:00   ` Mariusz Tkaczyk
2024-08-28  2:11 ` [PATCH 04/10] mdadm/Grow: sleep a while after removing disk in impose_level Xiao Ni
     [not found]   ` <20240902121359.00007a84@linux.intel.com>
2024-09-03  0:53     ` Xiao Ni
2024-09-03  7:22       ` Mariusz Tkaczyk [this message]
2024-09-11  8:42         ` Xiao Ni
2024-08-28  2:11 ` [PATCH 05/10] mdadm/tests: wait until level changes Xiao Ni
2024-08-28  2:11 ` [PATCH 06/10] mdadm/tests: 07changelevels fix Xiao Ni
2024-08-28  2:11 ` [PATCH 07/10] mdadm/tests: Remove 07reshape5intr.broken Xiao Ni
2024-08-28  2:11 ` [PATCH 08/10] mdadm/tests: 07testreshape5 fix Xiao Ni
2024-08-28  2:11 ` [PATCH 09/10] mdadm/tests: remove 09imsm-assemble.broken Xiao Ni
2024-08-28  2:11 ` [PATCH 10/10] mdadm/Manage: record errno Xiao Ni

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=20240903092214.00000d1d@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=xni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.