linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Kent <smkent@smkent.net>
To: NeilBrown <neilb@suse.de>
Cc: linux RAID <linux-raid@vger.kernel.org>
Subject: Re: mdadm named array (metadata 1.2) and udev when assembling an array in initramfs
Date: Sun, 2 Nov 2014 20:16:34 -0800	[thread overview]
Message-ID: <CAC45b7=H2kFg2VdFq2xdaQ=z4MebV3QC-aA1X5TO0ra=749puA@mail.gmail.com> (raw)
In-Reply-To: <20141103125020.19308fd5@notabene.brown>

On Sun, Nov 2, 2014 at 5:50 PM, NeilBrown <neilb@suse.de> wrote:
>
> Hi Stephen,
>  thanks for the bug report.
> This patch should fix it.
>
> NeilBrown
>
> From 628cdf19ea35daad22e409e51c0abc7ffb19d6aa Mon Sep 17 00:00:00 2001
> From: NeilBrown <neilb@suse.de>
> Date: Mon, 3 Nov 2014 12:49:05 +1100
> Subject: [PATCH] Rebuildmap: strip local host name from device name.
>
> When /run/mdadm/map is being rebuilt, e.g. by "mdadm -Ir",
> if the device doesn't exist in /dev, we have to choose
> a name.
> Currently we don't strip the hostname which is wrong if
> it is the local host.
>
> Reported-by: Stephen Kent <smkent@smkent.net>
> Signed-off-by: NeilBrown <neilb@suse.de>
>
> diff --git a/mapfile.c b/mapfile.c
> index 4e7f24214b8a..41599df05f97 100644
> --- a/mapfile.c
> +++ b/mapfile.c
> @@ -455,12 +455,19 @@ void RebuildMap(void)
>                                                         sep = "";
>                                                 }
>                                         }
> -                                       if (strchr(name, ':'))
> -                                               /* probably a uniquifying
> +                                       if (strchr(name, ':')) {
> +                                               /* Probably a uniquifying
>                                                  * hostname prefix.  Allow
> -                                                * without a suffix
> +                                                * without a suffix, and strip
> +                                                * hostname if it is us.
>                                                  */
> +                                               if (homehost && unum == -1 &&
> +                                                   strncmp(name, homehost,
> +                                                           strlen(homehost)) == 0 &&
> +                                                   name[strlen(homehost)] == ':')
> +                                                       name += strlen(homehost)+1;
>                                                 unum = -1;
> +                                       }
>
>                                         while (conflict) {
>                                                 if (unum >= 0)


Your patch works for me! Thanks so much for taking a look.

Stephen

  reply	other threads:[~2014-11-03  4:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03  1:50 mdadm named array (metadata 1.2) and udev when assembling an array in initramfs NeilBrown
2014-11-03  4:16 ` Stephen Kent [this message]
2014-11-03  5:43   ` NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2014-11-01 18:53 Stephen Kent
2014-11-04  9:06 ` Michael Tokarev
2014-11-04 18:17   ` Stephen Kent

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='CAC45b7=H2kFg2VdFq2xdaQ=z4MebV3QC-aA1X5TO0ra=749puA@mail.gmail.com' \
    --to=smkent@smkent.net \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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).