]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Assemble.c
Create.c: fix uclibc build
[thirdparty/mdadm.git] / Assemble.c
index 5be58e4066c57663156a68cbb5f19bcc015305ad..f6c5b99e25e246ee5a833f2fa0c6f25f41c4d669 100644 (file)
@@ -1806,12 +1806,6 @@ try_again:
                                               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,
@@ -1990,13 +1984,11 @@ int assemble_container_content(struct supertype *st, int mdfd,
                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;
                }
@@ -2023,8 +2015,7 @@ int assemble_container_content(struct supertype *st, int mdfd,
                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;