Re: mdadm: super0: do not override uuid with homehost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 20 Oct 2012 20:09:27 +0400 Michael Tokarev <mjt@xxxxxxxxxx> 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@xxxxxxxxxx>
> > 
> > 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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux