]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm: super0: do not override uuid with homehost
authorMichael Tokarev <mjt@tls.msk.ru>
Sat, 20 Oct 2012 11:40:02 +0000 (15:40 +0400)
committerNeilBrown <neilb@suse.de>
Sun, 21 Oct 2012 21:48:18 +0000 (08:48 +1100)
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>
Signed-off-by: NeilBrown <neilb@suse.de>
super0.c

index ac56d05cda296f8bfebb5f24718cbcbb61b9a4a3..a748967e26ab8697cbf5359d3a0e63874c477931 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -662,7 +662,7 @@ static int init_super0(struct supertype *st, mdu_array_info_t *info,
                if (rfd >= 0)
                        close(rfd);
        }
-       if (homehost) {
+       if (homehost && !uuid) {
                char buf[20];
                char *hash = sha1_buffer(homehost,
                                         strlen(homehost),