linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jes.sorensen@gmail.com
To: Zhilong Liu <zlliu@suse.com>
Cc: linux-raid@vger.kernel.org, Harald Hoyer <harald@redhat.com>
Subject: Re: [PATCH] mdadm/grow: reshape would be stuck from raid1 to raid5
Date: Mon, 27 Mar 2017 18:10:08 -0400	[thread overview]
Message-ID: <wrfjk27aid6n.fsf@gmail.com> (raw)
In-Reply-To: <1489987229-22631-1-git-send-email-zlliu@suse.com> (Zhilong Liu's message of "Mon, 20 Mar 2017 13:20:29 +0800")

Zhilong Liu <zlliu@suse.com> writes:
> it would be stuck at the beginning of reshape progress
> when grows array from raid1 to raid5, correct the name
> of mdadm-grow-continue@.service in continue_via_systemd.
>
> reproduce steps:
> ./mdadm -CR /dev/md0 -l1 -b internal -n2 /dev/loop[0-1]
> ./mdadm --grow /dev/md0 -l5 -n3 -a /dev/loop2
>
> Signed-off-by: Zhilong Liu <zlliu@suse.com>
> ---
>  Grow.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/Grow.c b/Grow.c
> index 455c5f9..10c02a1 100755
> --- a/Grow.c
> +++ b/Grow.c
> @@ -2808,13 +2808,11 @@ static int continue_via_systemd(char *devnm)
>  		 */
>  		close(2);
>  		open("/dev/null", O_WRONLY);
> -		snprintf(pathbuf, sizeof(pathbuf), "mdadm-grow-continue@%s.service",
> -			 devnm);
> +		snprintf(pathbuf, sizeof(pathbuf), "mdadm-grow-continue@.service");

My memory is rusty here, isn't systemctl interpreting the device name in
mdadm-grow-continue@<device>.service as an argument?

>  		status = execl("/usr/bin/systemctl", "systemctl",
>  			       "start",
>  			       pathbuf, NULL);
> -		status = execl("/bin/systemctl", "systemctl", "start",
> -			       pathbuf, NULL);
> +		pr_err("/usr/bin/systemctl %s got failure\n", pathbuf);
>  		exit(1);

This assumes systemctl is location in /usr/bin only - you removed the
fallback case for it being location in /bin.

In addition, instead of saying 'got failure' lets do something with the
errno value so the user gets a more descriptive error message.

Cheers,
Jes

  reply	other threads:[~2017-03-27 22:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20  5:20 [PATCH] mdadm/grow: reshape would be stuck from raid1 to raid5 Zhilong Liu
2017-03-27 22:10 ` jes.sorensen [this message]
2017-03-28 14:03   ` Liu Zhilong
2017-03-30  7:38   ` [PATCH v1] " Zhilong Liu
2017-03-30 15:50     ` Jes Sorensen
2017-04-03  4:36     ` NeilBrown
2017-04-04  5:07       ` Zhilong
2017-04-04  5:40         ` Zhilong
2017-04-04  6:30           ` NeilBrown
2017-04-05 15:37             ` jes.sorensen

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=wrfjk27aid6n.fsf@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=harald@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=zlliu@suse.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).