]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-ddf.c
Introduce MaxSector
[thirdparty/mdadm.git] / super-ddf.c
index 06858e23fb9cbc3f0fc94874c2b9905d9a6ca73a..8c3f4bebffe195cc7baea9c71ced1188f896c85c 100644 (file)
@@ -1366,7 +1366,7 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info)
                info->disk.raid_disk = -1;
 //             info->disk.raid_disk = find refnum in the table and use index;
        }
-       info->disk.state = (1 << MD_DISK_SYNC);
+       info->disk.state = (1 << MD_DISK_SYNC) | (1 << MD_DISK_ACTIVE);
 
 
        info->reshape_active = 0;
@@ -1433,7 +1433,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info)
            (ddf->virt->entries[info->container_member].init_state
             & DDF_initstate_mask)
            == DDF_init_full)
-               info->resync_start = ~0ULL;
+               info->resync_start = MaxSector;
 
        uuid_from_super_ddf(st, info->uuid);
 
@@ -2555,8 +2555,12 @@ static int validate_geometry_ddf(struct supertype *st,
                for (i=0; ddf_level_num[i].num1 != MAXINT; i++)
                        if (ddf_level_num[i].num2 == level)
                                break;
-               if (ddf_level_num[i].num1 == MAXINT)
+               if (ddf_level_num[i].num1 == MAXINT) {
+                       if (verbose)
+                               fprintf(stderr, Name ": DDF does not support level %d arrays\n",
+                                       level);
                        return 0;
+               }
                /* Should check layout? etc */
 
                if (st->sb && freesize) {
@@ -2604,7 +2608,7 @@ static int validate_geometry_ddf(struct supertype *st,
                if (verbose)
                        fprintf(stderr,
                                Name ": ddf: Cannot create this array "
-                               "on device %s\n",
+                               "on device %s - a container is required.\n",
                                dev);
                return 0;
        }
@@ -2696,8 +2700,11 @@ static int validate_geometry_ddf_bvd(struct supertype *st,
        struct extent *e;
        int i;
        /* ddf/bvd supports lots of things, but not containers */
-       if (level == LEVEL_CONTAINER)
+       if (level == LEVEL_CONTAINER) {
+               if (verbose)
+                       fprintf(stderr, Name ": DDF cannot create a container within an container\n");
                return 0;
+       }
        /* We must have the container info already read in. */
        if (!ddf)
                return 0;
@@ -2914,7 +2921,7 @@ static struct mdinfo *container_content_ddf(struct supertype *st)
                        this->resync_start = 0;
                } else {
                        this->array.state = 1;
-                       this->resync_start = ~0ULL;
+                       this->resync_start = MaxSector;
                }
                memcpy(this->name, ddf->virt->entries[i].name, 16);
                this->name[16]=0;
@@ -3059,7 +3066,7 @@ static int ddf_set_array_state(struct active_array *a, int consistent)
        if (consistent == 2) {
                /* Should check if a recovery should be started FIXME */
                consistent = 1;
-               if (!is_resync_complete(a))
+               if (!is_resync_complete(&a->info))
                        consistent = 0;
        }
        if (consistent)
@@ -3071,9 +3078,9 @@ static int ddf_set_array_state(struct active_array *a, int consistent)
 
        old = ddf->virt->entries[inst].init_state;
        ddf->virt->entries[inst].init_state &= ~DDF_initstate_mask;
-       if (is_resync_complete(a))
+       if (is_resync_complete(&a->info))
                ddf->virt->entries[inst].init_state |= DDF_init_full;
-       else if (a->resync_start == 0)
+       else if (a->info.resync_start == 0)
                ddf->virt->entries[inst].init_state |= DDF_init_not;
        else
                ddf->virt->entries[inst].init_state |= DDF_init_quick;
@@ -3081,7 +3088,7 @@ static int ddf_set_array_state(struct active_array *a, int consistent)
                ddf->updates_pending = 1;
 
        dprintf("ddf mark %d %s %llu\n", inst, consistent?"clean":"dirty",
-               a->resync_start);
+               a->info.resync_start);
        return consistent;
 }