st->ss->getinfo_super(st, &ap->info);
st->ss->free_super(st);
}
- if (!(ap->info.disk.state & MD_DISK_SYNC))
+ if (!(ap->info.disk.state & (1<<MD_DISK_SYNC)))
ap->spares++;
d = dl_strdup(devlist->devname);
dl_add(ap->devs, d);
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);
s = __le32_to_cpu(disk->status);
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;
+ info->disk.state |= s & SPARE_DISK ? 0 : (1 << MD_DISK_SYNC);
}
- if (is_spare)
- memcpy(info->uuid, uuid_match_any, sizeof(int[4]));
- else
+ if (info->disk.state & (1 << MD_DISK_SYNC))
uuid_from_super_imsm(st, info->uuid);
+ else
+ memcpy(info->uuid, uuid_match_any, sizeof(int[4]));
}
static int update_super_imsm(struct supertype *st, struct mdinfo *info,