extern void free_line(char *line);
extern int match_oneof(char *devices, char *devname);
extern void uuid_from_super(int uuid[4], mdp_super_t *super);
+extern const int uuid_match_any[4];
extern int same_uuid(int a[4], int b[4], int swapuuid);
extern void copy_uuid(void *a, int b[4], int swapuuid);
extern char *fname_from_uuid(struct supertype *st,
struct intel_super *super = st->sb;
struct imsm_disk *disk;
__u32 s;
+ int is_spare = 0;
if (super->current_vol >= 0) {
getinfo_super_imsm_volume(st, info);
info->disk.state = s & CONFIGURED_DISK ? (1 << MD_DISK_ACTIVE) : 0;
info->disk.state |= s & FAILED_DISK ? (1 << MD_DISK_FAULTY) : 0;
info->disk.state |= s & USABLE_DISK ? (1 << MD_DISK_SYNC) : 0;
+ if (s & SPARE_DISK)
+ is_spare = 1;
}
- uuid_from_super_imsm(st, info->uuid);
+ if (is_spare)
+ memcpy(info->uuid, uuid_match_any, sizeof(int[4]));
+ else
+ uuid_from_super_imsm(st, info->uuid);
}
static int update_super_imsm(struct supertype *st, struct mdinfo *info,
}
}
+const int uuid_match_any[4] = { ~0, ~0, ~0, ~0 };
int same_uuid(int a[4], int b[4], int swapuuid)
{
+ if (memcmp(a, uuid_match_any, sizeof(int[4])) == 0 ||
+ memcmp(b, uuid_match_any, sizeof(int[4])) == 0)
+ return 1;
+
if (swapuuid) {
/* parse uuids are hostendian.
* uuid's from some superblocks are big-ending