From: NeilBrown <neilb@suse.de>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: linux RAID <linux-raid@vger.kernel.org>
Subject: Re: mdadm: super0: do not override uuid with homehost
Date: Mon, 22 Oct 2012 08:50:44 +1100 [thread overview]
Message-ID: <20121022085044.044026cf@notabene.brown> (raw)
In-Reply-To: <5082CCB7.3010402@msgid.tls.msk.ru>
[-- Attachment #1: Type: text/plain, Size: 1347 bytes --]
On Sat, 20 Oct 2012 20:09:27 +0400 Michael Tokarev <mjt@tls.msk.ru> wrote:
> On 20.10.2012 19:40, Michael Tokarev wrote:
> > When --uuid is specified in the command line, even for v0.90
> > superblock we override last portion of uuid with data from
> > --homehost, which is wrong (and disagrees with the manpage).
> > Only use homehost in super0 if no uuid is specified.
> >
> > Signed-off-By: Michael Tokarev <mjt@tls.msk.ru>
> >
> > diff --git a/super0.c b/super0.c
> > index 1375799..ca4c082 100644
> > --- a/super0.c
> > +++ b/super0.c
> > @@ -657,7 +657,7 @@ static int init_super0(struct supertype *st, mdu_array_info_t *info,
> > if (rfd >= 0)
> > close(rfd);
> > }
> > - if (homehost) {
> > + if (homehost && !uuid) {
>
> Besides, do we need to check *homehost here too,
> in order to be able to unset homehost given in
> config file or whatnot, by setting it to an empty
> string?
No we don't.
if (homehost && (!homehost[0] || strcasecmp(homehost, "<none>") == 0)) {
homehost = NULL;
require_homehost = 0;
}
(from 3.2.x, slightly different in 'master') so if *homehost would be nul,
homehost gets set to NULL.
I've applied your patch as-is.
Thanks,
NeilBrown
>
> /mjt
>
>
> > char buf[20];
> > char *hash = sha1_buffer(homehost,
> > strlen(homehost),
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2012-10-21 21:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-20 15:40 mdadm: super0: do not override uuid with homehost Michael Tokarev
2012-10-20 16:09 ` Michael Tokarev
2012-10-21 21:50 ` 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=20121022085044.044026cf@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=mjt@tls.msk.ru \
/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.