]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - managemon.c
test/10-ddf-create: fix comments
[thirdparty/mdadm.git] / managemon.c
index d155b042c1414071dd880eb4dad7ec7249d8493c..f50f95475aa7d33ff43b2aa206a4d7134543d94f 100644 (file)
@@ -343,7 +343,7 @@ static void manage_container(struct mdstat_ent *mdstat,
                             struct supertype *container)
 {
        /* Of interest here are:
-        * - if a new device has been added to the container, we 
+        * - if a new device has been added to the container, we
         *   add it to the array ignoring any metadata on it.
         * - if a device has been removed from the container, we
         *   remove it from the device list and update the metadata.
@@ -444,6 +444,7 @@ static void manage_member(struct mdstat_ent *mdstat,
        char buf[64];
        int frozen;
        struct supertype *container = a->container;
+       unsigned long long int component_size = 0;
 
        if (container == NULL)
                /* Raced with something */
@@ -453,6 +454,9 @@ static void manage_member(struct mdstat_ent *mdstat,
        a->info.array.raid_disks = mdstat->raid_disks;
        // MORE
 
+       if (sysfs_get_ll(&a->info, NULL, "component_size", &component_size) >= 0)
+               a->info.component_size = component_size << 1;
+
        /* honor 'frozen' */
        if (sysfs_get_str(&a->info, NULL, "metadata_version", buf, sizeof(buf)) > 0)
                frozen = buf[9] == '-';
@@ -635,7 +639,6 @@ static void manage_new(struct mdstat_ent *mdstat,
                         GET_LEVEL|GET_CHUNK|GET_DISKS|GET_COMPONENT|
                         GET_DEGRADED|GET_DEVS|GET_OFFSET|GET_SIZE|GET_STATE);
 
-
        if (!mdi)
                return;
        new = xcalloc(1, sizeof(*new));
@@ -709,7 +712,7 @@ static void manage_new(struct mdstat_ent *mdstat,
         * manage this instance
         */
        if (!aa_ready(new) || container->ss->open_new(container, new, inst) < 0) {
-               fprintf(stderr, "mdmon: failed to monitor %s\n",
+               pr_err("failed to monitor %s\n",
                        mdstat->metadata_version);
                new->container = NULL;
                free_aa(new);
@@ -765,7 +768,7 @@ static void handle_message(struct supertype *container, struct metadata_update *
 
        if (msg->len == 0) { /* ping_monitor */
                int cnt;
-               
+
                cnt = monitor_loop_cnt;
                if (cnt & 1)
                        cnt += 2; /* wait until next pselect */