summaryrefslogtreecommitdiffstats
path: root/super0.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-19 07:19:04 +0000
committerNeil Brown <neilb@suse.de>2006-05-19 07:19:04 +0000
commita1cbd7d053e034bbfcf337bc9ee7b92ec4c6f6c0 (patch)
tree96ccd12c23643ef4ba48ab6c8768cf7ce75628e6 /super0.c
parentb6750aa8da57bfc0eb3a3bdc47c289638b1022c8 (diff)
downloadmdadm-a1cbd7d053e034bbfcf337bc9ee7b92ec4c6f6c0.tar.gz
mdadm-a1cbd7d053e034bbfcf337bc9ee7b92ec4c6f6c0.tar.xz
mdadm-a1cbd7d053e034bbfcf337bc9ee7b92ec4c6f6c0.zip
Include homehost information in --examine as appropriate
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/super0.c b/super0.c
index d1fbfae..dbf59c8 100644
--- a/super0.c
+++ b/super0.c
@@ -84,7 +84,7 @@ void super0_swap_endian(struct mdp_superblock_s *sb)
#ifndef MDASSEMBLE
-static void examine_super0(void *sbv)
+static void examine_super0(void *sbv, char *homehost)
{
mdp_super_t *sb = sbv;
time_t atime;
@@ -94,10 +94,18 @@ static void examine_super0(void *sbv)
printf(" Magic : %08x\n", sb->md_magic);
printf(" Version : %02d.%02d.%02d\n", sb->major_version, sb->minor_version,
sb->patch_version);
- if (sb->minor_version >= 90)
- printf(" UUID : %08x:%08x:%08x:%08x\n", sb->set_uuid0, sb->set_uuid1,
+ if (sb->minor_version >= 90) {
+ printf(" UUID : %08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1,
sb->set_uuid2, sb->set_uuid3);
- else
+ if (homehost) {
+ unsigned char *hash = SHA1((unsigned char *)homehost,
+ strlen(homehost),
+ NULL);
+ if (memcmp(&sb->set_uuid2, hash, 8)==0)
+ printf(" (local to host %s)", homehost);
+ }
+ printf("\n");
+ } else
printf(" UUID : %08x\n", sb->set_uuid0);
atime = sb->ctime;