linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Justin Maggard <jmaggard10@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] Create new md devices consistently
Date: Wed, 24 Oct 2012 12:09:57 +1100	[thread overview]
Message-ID: <20121024120957.65aa4318@notabene.brown> (raw)
In-Reply-To: <1351029840-5030-1-git-send-email-jmaggard10@gmail.com>

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

On Tue, 23 Oct 2012 15:04:00 -0700 Justin Maggard <jmaggard10@gmail.com>
wrote:

>  Creating a new MD device with the name 'd-0' results in some
>  unexpected behavior, since mdadm sees that '-0' is a
>  non-negative integer and therefore makes a "partitionable"
>  device (/dev/md_d0).  This is not the expected behavior,
>  since the documentation mentions 'dN' several places, and a
>  reboot brings it up as /dev/md/d-0.  Make this consistent
>  by ensuring that the character immediately following 'd' is
>  a digit during creation.
> 
> ---
>  mdopen.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/mdopen.c b/mdopen.c
> index 61eda81..24188df 100644
> --- a/mdopen.c
> +++ b/mdopen.c
> @@ -207,7 +207,10 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
>  			char *ep;
>  			if (cname[0] == 'd')
>  				sp++;
> -			num = strtoul(sp, &ep, 10);
> +			if (isdigit(sp[0]))
> +				num = strtoul(sp, &ep, 10);
> +			else
> +				ep = sp;
>  			if (ep == sp || *ep || num < 0)
>  				num = -1;
>  			else if (cname[0] == 'd')

applied, thanks.

Will be in mdadm-3.2.6 which I plan to release tomorrow.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2012-10-24  1:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 22:04 [PATCH] Create new md devices consistently Justin Maggard
2012-10-24  1:09 ` NeilBrown [this message]

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=20121024120957.65aa4318@notabene.brown \
    --to=neilb@suse.de \
    --cc=jmaggard10@gmail.com \
    --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).