/* make sure we finished the loop */
tmpdev = NULL;
- free(st);
- st = NULL;
goto loop;
} else {
content = *contentp;
i, mddev, devices[j].devname);
}
}
-#if 0
- if (!(super.disks[i].i.disk.state & (1 << MD_DISK_FAULTY))) {
- pr_err("devices %d of %s is not marked FAULTY in superblock, but cannot be found\n",
- i, mddev);
- }
-#endif
}
if (c->force && !clean && !is_container(content->array.level) &&
!enough(content->array.level, content->array.raid_disks,
return 1;
}
- if (strcmp(sra->text_version, content->text_version) != 0) {
- if (content->array.major_version == -1 &&
- content->array.minor_version == -2 &&
- c->readonly &&
- content->text_version[0] == '/')
- content->text_version[0] = '-';
- if (sysfs_set_array(content, 9003) != 0) {
+ /* Fill sysfs properties only if they are not set. Determine it by checking text_version
+ * and ignoring special character on the first place.
+ */
+ if (strcmp(sra->text_version + 1, content->text_version + 1) != 0) {
+ if (sysfs_set_array(content) != 0) {
sysfs_free(sra);
return 1;
}
if (dev)
continue;
/* Don't want this one any more */
- if (sysfs_set_str(sra, dev2, "slot", "none") < 0 &&
- errno == EBUSY) {
+ if (sysfs_set_str(sra, dev2, "slot", STR_COMMON_NONE) < 0 && errno == EBUSY) {
pr_err("Cannot remove old device %s: not updating %s\n", dev2->sys_name, sra->sys_name);
sysfs_free(sra);
return 1;