linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Luca Berra <bluca@comedia.it>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>
Subject: Re: [mdadm PATCH 1/2] fix mdmon option parsing
Date: Tue, 2 Mar 2010 16:40:34 +1100	[thread overview]
Message-ID: <20100302164034.48e6da62@notabene.brown> (raw)
In-Reply-To: <1-2.1267282753.git.bluca@comedia.it>

On Sat, 27 Feb 2010 16:07:04 +0100
Luca Berra <bluca@comedia.it> wrote:

> running mdmon --takeover --all resulted in a segfault.
> also hide "--takeover" from ps and update usage message.

Why do you want to hide the "--takeover" ???

(the rest makes sense, thanks).

NeilBrown

> 
> Signed-off-by: Luca Berra <bluca@comedia.it>
> ---
>   mdmon.c |   13 +++++++++----
>   1 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/mdmon.c b/mdmon.c
> index 70fbd0b..d593ebc 100644
> --- a/mdmon.c
> +++ b/mdmon.c
> @@ -244,7 +244,7 @@ static int do_fork(void)
>   
>   void usage(void)
>   {
> -	fprintf(stderr, "Usage: mdmon /device/name/for/container [target_dir]\n");
> +	fprintf(stderr, "Usage: mdmon [--all] [--takeover] CONTAINER");
>   	exit(2);
>   }
>   
> @@ -262,15 +262,20 @@ int main(int argc, char *argv[])
>   
>   	for (arg = 1; arg < argc; arg++) {
>   		if (strcmp(argv[arg], "--all") == 0 ||
> -		    strcmp(argv[arg], "/proc/mdstat") == 0)
> +		    strcmp(argv[arg], "/proc/mdstat") == 0) {
> +			container_name = argv[arg];
>   			all = 1;
> -		else if (strcmp(argv[arg], "--takeover") == 0)
> +		} else if (strcmp(argv[arg], "--takeover") == 0) {
> +			/* hide the --takeover arg from commandline */
> +			memset(argv[arg], 0, strlen(argv[arg]));
>   			takeover = 1;
> -		else if (container_name == NULL)
> +		} else if (container_name == NULL)
>   			container_name = argv[arg];
>   		else
>   			usage();
>   	}
> +	if (container_name == NULL)
> +		usage();
>   
>   	if (all) {
>   		struct mdstat_ent *mdstat, *e;


  parent reply	other threads:[~2010-03-02  5:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-27 15:05 [mdadm PATCH 0/2] *** mdmon fixes *** Luca Berra
2010-02-27 15:07 ` [mdadm PATCH 1/2] fix mdmon option parsing Luca Berra
2010-02-27 15:21   ` Luca Berra
2010-03-02  5:40   ` Neil Brown [this message]
2010-03-02  7:42     ` Luca Berra
2010-02-27 15:07 ` [mdadm PATCH 2/2] fix mdmon takeover Luca Berra
2010-03-03  0:52   ` Neil Brown
2010-02-28 14:41 ` [mdadm PATCH 0/2] *** mdmon fixes *** Luca Berra
2010-02-28 14:42   ` [mdadm PATCH 3/9] add missing newline to mdmon usage message Luca Berra
2010-02-28 14:42   ` [mdadm PATCH 4/9] mdmon: check select a writable pid_dir Luca Berra
2010-03-03  1:07     ` Neil Brown
2010-02-28 14:43   ` [mdadm PATCH 5/9] mdmon: mdmon_pid should return pid from either dir Luca Berra
2010-03-03  1:50     ` Neil Brown
2010-03-03  6:44       ` Luca Berra
2010-03-03  6:55         ` Neil Brown
2010-03-03  7:09           ` Luca Berra
2010-02-28 14:44   ` [mdadm PATCH 6/9] mdmon: connect_monitor should use socket " Luca Berra
2010-03-03  1:51     ` Neil Brown
2010-02-28 14:45   ` [mdadm PATCH 7/9] mdmon: move pid_dir to mdmon.c Luca Berra
2010-02-28 14:45   ` [mdadm PATCH 8/9] mdmon: rework startup and takeover logic Luca Berra
2010-03-03  1:52     ` Neil Brown
2010-03-03  6:48       ` Luca Berra
2010-02-28 14:46   ` [mdadm PATCH 9/9] allow redefinition of VAR_RUN Luca Berra
2010-03-03  1:53     ` Neil Brown
2010-02-28 15:41   ` [mdadm PATCH 0/2] *** mdmon fixes *** Bill Davidsen
2010-02-28 17:37     ` Luca Berra

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=20100302164034.48e6da62@notabene.brown \
    --to=neilb@suse.de \
    --cc=bluca@comedia.it \
    --cc=linux-raid@vger.kernel.org \
    /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).