X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=super0.c;h=ebebc491ae7ec42d57f7639ced7fa82c5da03e16;hb=refs%2Fheads%2Fr10-reshape;hp=924d75d3e7692def4996b4de811191331d1bae06;hpb=492350045c7e40741069caa7d017209439db665b;p=thirdparty%2Fmdadm.git diff --git a/super0.c b/super0.c index 924d75d3..ebebc491 100644 --- a/super0.c +++ b/super0.c @@ -1,7 +1,7 @@ /* * mdadm - manage Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2006 Neil Brown + * Copyright (C) 2001-2009 Neil Brown * * * This program is free software; you can redistribute it and/or modify @@ -19,12 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Neil Brown - * Email: - * Paper: Neil Brown - * School of Computer Science and Engineering - * The University of New South Wales - * Sydney, 2052 - * Australia + * Email: */ #define HAVE_STDINT_H 1 @@ -90,10 +85,11 @@ static void examine_super0(struct supertype *st, char *homehost) mdp_super_t *sb = st->sb; time_t atime; int d; + int delta_extra = 0; char *c; printf(" Magic : %08x\n", sb->md_magic); - printf(" Version : %02d.%02d.%02d\n", sb->major_version, sb->minor_version, + printf(" Version : %d.%02d.%02d\n", sb->major_version, sb->minor_version, sb->patch_version); if (sb->minor_version >= 90) { printf(" UUID : %08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1, @@ -117,8 +113,8 @@ static void examine_super0(struct supertype *st, char *homehost) printf(" Creation Time : %.24s\n", ctime(&atime)); c=map_num(pers, sb->level); printf(" Raid Level : %s\n", c?c:"-unknown-"); - if ((int)sb->level >= 0) { - int ddsks=0; + if ((int)sb->level > 0) { + int ddsks = 0, ddsks_denom = 1; printf(" Used Dev Size : %d%s\n", sb->size, human_size((long long)sb->size<<10)); switch(sb->level) { @@ -126,11 +122,15 @@ static void examine_super0(struct supertype *st, char *homehost) case 4: case 5: ddsks = sb->raid_disks-1; break; case 6: ddsks = sb->raid_disks-2; break; - case 10: ddsks = sb->raid_disks / (sb->layout&255) / ((sb->layout>>8)&255); + case 10: ddsks = sb->raid_disks; + ddsks_denom = (sb->layout&255) * ((sb->layout>>8)&255); + } + if (ddsks) { + long long asize = sb->size; + asize = (asize << 10) * ddsks / ddsks_denom; + printf(" Array Size : %llu%s\n", + asize >> 10, human_size(asize)); } - if (ddsks) - printf(" Array Size : %llu%s\n", (unsigned long long)ddsks * sb->size, - human_size(ddsks*(long long)sb->size<<10)); } printf(" Raid Devices : %d\n", sb->raid_disks); printf(" Total Devices : %d\n", sb->nr_disks); @@ -140,10 +140,9 @@ static void examine_super0(struct supertype *st, char *homehost) printf(" Reshape pos'n : %llu%s\n", (unsigned long long)sb->reshape_position/2, human_size((long long)sb->reshape_position<<9)); if (sb->delta_disks) { printf(" Delta Devices : %d", sb->delta_disks); - if (sb->delta_disks) - printf(" (%d->%d)\n", sb->raid_disks-sb->delta_disks, sb->raid_disks); - else - printf(" (%d->%d)\n", sb->raid_disks, sb->raid_disks+sb->delta_disks); + printf(" (%d->%d)\n", sb->raid_disks-sb->delta_disks, sb->raid_disks); + if (((int)sb->delta_disks) < 0) + delta_extra = - sb->delta_disks; } if (sb->new_level != sb->level) { c = map_num(pers, sb->new_level); @@ -154,6 +153,10 @@ static void examine_super0(struct supertype *st, char *homehost) c = map_num(r5layout, sb->new_layout); printf(" New Layout : %s\n", c?c:"-unknown-"); } + if (sb->level == 6) { + c = map_num(r6layout, sb->new_layout); + printf(" New Layout : %s\n", c?c:"-unknown-"); + } if (sb->level == 10) { printf(" New Layout : near=%d, %s=%d\n", sb->new_layout&255, @@ -187,6 +190,10 @@ static void examine_super0(struct supertype *st, char *homehost) c = map_num(r5layout, sb->layout); printf(" Layout : %s\n", c?c:"-unknown-"); } + if (sb->level == 6) { + c = map_num(r6layout, sb->layout); + printf(" Layout : %s\n", c?c:"-unknown-"); + } if (sb->level == 10) { printf(" Layout :"); print_r10_layout(sb->layout); @@ -207,7 +214,7 @@ static void examine_super0(struct supertype *st, char *homehost) } printf("\n"); printf(" Number Major Minor RaidDevice State\n"); - for (d= -1; d<(signed int)(sb->raid_disks+sb->spare_disks); d++) { + for (d= -1; d<(signed int)(sb->raid_disks+delta_extra + sb->spare_disks); d++) { mdp_disk_t *dp; char *dv; char nb[5]; @@ -232,7 +239,7 @@ static void examine_super0(struct supertype *st, char *homehost) } } -static void brief_examine_super0(struct supertype *st) +static void brief_examine_super0(struct supertype *st, int verbose) { mdp_super_t *sb = st->sb; char *c=map_num(pers, sb->level); @@ -240,14 +247,18 @@ static void brief_examine_super0(struct supertype *st) sprintf(devname, "/dev/md%d", sb->md_minor); - printf("ARRAY %s level=%s num-devices=%d UUID=", - devname, - c?c:"-unknown-", sb->raid_disks); + if (verbose) { + printf("ARRAY %s level=%s num-devices=%d", + devname, + c?c:"-unknown-", sb->raid_disks); + } else + printf("ARRAY %s", devname); + if (sb->minor_version >= 90) - printf("%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1, + printf(" UUID=%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1, sb->set_uuid2, sb->set_uuid3); else - printf("%08x", sb->set_uuid0); + printf(" UUID=%08x", sb->set_uuid0); printf("\n"); } @@ -306,9 +317,13 @@ static int match_home0(struct supertype *st, char *homehost) { mdp_super_t *sb = st->sb; char buf[20]; - char *hash = sha1_buffer(homehost, - strlen(homehost), - buf); + char *hash; + + if (!homehost) + return 0; + hash = sha1_buffer(homehost, + strlen(homehost), + buf); return (memcmp(&sb->set_uuid2, hash, 8)==0); } @@ -328,12 +343,14 @@ static void uuid_from_super0(struct supertype *st, int uuid[4]) } } -static void getinfo_super0(struct supertype *st, struct mdinfo *info) +static void getinfo_super0(struct supertype *st, struct mdinfo *info, char *map) { mdp_super_t *sb = st->sb; int working = 0; int i; + int map_disks = info->array.raid_disks; + memset(info, 0, sizeof(*info)); info->array.major_version = sb->major_version; info->array.minor_version = sb->minor_version; info->array.patch_version = sb->patch_version; @@ -347,6 +364,9 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info) info->array.state = sb->state; info->component_size = sb->size*2; + if (sb->state & (1<bitmap_offset = 8; + info->disk.state = sb->this_disk.state; info->disk.major = sb->this_disk.major; info->disk.minor = sb->this_disk.minor; @@ -361,6 +381,7 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info) uuid_from_super0(st, info->uuid); + info->recovery_start = MaxSector; if (sb->minor_version > 90 && (sb->reshape_position+1) != 0) { info->reshape_active = 1; info->reshape_progress = sb->reshape_position; @@ -368,30 +389,51 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info) info->delta_disks = sb->delta_disks; info->new_layout = sb->new_layout; info->new_chunk = sb->new_chunk; + if (info->delta_disks < 0) + info->array.raid_disks -= info->delta_disks; } else info->reshape_active = 0; + info->recovery_blocked = info->reshape_active; + sprintf(info->name, "%d", sb->md_minor); /* work_disks is calculated rather than read directly */ for (i=0; i < MD_SB_DISKS; i++) if ((sb->disks[i].state & (1<disks[i].raid_disk < info->array.raid_disks) && + (sb->disks[i].raid_disk < (unsigned)info->array.raid_disks) && (sb->disks[i].state & (1<disks[i].state & (1<disks[i].state & (1<array.working_disks = working; } +static struct mdinfo *container_content0(struct supertype *st, char *subarray) +{ + struct mdinfo *info; + + if (subarray) + return NULL; + + info = malloc(sizeof(*info)); + getinfo_super0(st, info, NULL); + return info; +} static int update_super0(struct supertype *st, struct mdinfo *info, char *update, char *devname, int verbose, int uuid_set, char *homehost) { - /* NOTE: for 'assemble' and 'force' we need to return non-zero if any change was made. - * For others, the return value is ignored. + /* NOTE: for 'assemble' and 'force' we need to return non-zero + * if any change was made. For others, the return value is + * ignored. */ int rv = 0; + int uuid[4]; mdp_super_t *sb = st->sb; if (strcmp(update, "sparc2.2")==0 ) { /* 2.2 sparc put the events in the wrong place @@ -405,15 +447,13 @@ static int update_super0(struct supertype *st, struct mdinfo *info, if (verbose >= 0) fprintf (stderr, Name ": adjusting superblock of %s for 2.2/sparc compatability.\n", devname); - } - if (strcmp(update, "super-minor") ==0) { + } else if (strcmp(update, "super-minor") ==0) { sb->md_minor = info->array.md_minor; if (verbose > 0) fprintf(stderr, Name ": updating superblock of %s with minor number %d\n", devname, info->array.md_minor); - } - if (strcmp(update, "summaries") == 0) { - int i; + } else if (strcmp(update, "summaries") == 0) { + unsigned int i; /* set nr_disks, active_disks, working_disks, * failed_disks, spare_disks based on disks[] * array in superblock. @@ -439,8 +479,7 @@ static int update_super0(struct supertype *st, struct mdinfo *info, sb->spare_disks++; } else if (i >= sb->raid_disks && sb->disks[i].number == 0) sb->disks[i].state = 0; - } - if (strcmp(update, "force-one")==0) { + } else if (strcmp(update, "force-one")==0) { /* Not enough devices for a working array, so * bring this one up-to-date. */ @@ -450,8 +489,7 @@ static int update_super0(struct supertype *st, struct mdinfo *info, if (sb->events_hi != ehi || sb->events_lo != elo) rv = 1; - } - if (strcmp(update, "force-array")==0) { + } else if (strcmp(update, "force-array")==0) { /* degraded array and 'force' requested, so * maybe need to mark it 'clean' */ @@ -461,17 +499,36 @@ static int update_super0(struct supertype *st, struct mdinfo *info, sb->state |= (1 << MD_SB_CLEAN); rv = 1; } - } - if (strcmp(update, "assemble")==0) { + } else if (strcmp(update, "assemble")==0) { int d = info->disk.number; int wonly = sb->disks[d].state & (1<disks[d].state & ~(1<disk.state) { + int mask = (1<minor_version >= 91) + /* During reshape we don't insist on everything + * being marked 'sync' + */ + add = (1<disks[d].state & ~mask) | add) + != (unsigned)info->disk.state) { sb->disks[d].state = info->disk.state | wonly; rv = 1; } - } - if (strcmp(update, "linear-grow-new") == 0) { + if (info->reshape_active && + sb->minor_version > 90 && (sb->reshape_position+1) != 0 && + info->delta_disks >= 0 && + info->reshape_progress < sb->reshape_position) { + sb->reshape_position = info->reshape_progress; + rv = 1; + } + if (info->reshape_active && + sb->minor_version > 90 && (sb->reshape_position+1) != 0 && + info->delta_disks < 0 && + info->reshape_progress > sb->reshape_position) { + sb->reshape_position = info->reshape_progress; + rv = 1; + } + } else if (strcmp(update, "linear-grow-new") == 0) { memset(&sb->disks[info->disk.number], 0, sizeof(sb->disks[0])); sb->disks[info->disk.number].number = info->disk.number; sb->disks[info->disk.number].major = info->disk.major; @@ -479,8 +536,7 @@ static int update_super0(struct supertype *st, struct mdinfo *info, sb->disks[info->disk.number].raid_disk = info->disk.raid_disk; sb->disks[info->disk.number].state = info->disk.state; sb->this_disk = sb->disks[info->disk.number]; - } - if (strcmp(update, "linear-grow-update") == 0) { + } else if (strcmp(update, "linear-grow-update") == 0) { sb->raid_disks = info->array.raid_disks; sb->nr_disks = info->array.nr_disks; sb->active_disks = info->array.active_disks; @@ -491,20 +547,17 @@ static int update_super0(struct supertype *st, struct mdinfo *info, sb->disks[info->disk.number].minor = info->disk.minor; sb->disks[info->disk.number].raid_disk = info->disk.raid_disk; sb->disks[info->disk.number].state = info->disk.state; - } - if (strcmp(update, "resync") == 0) { + } else if (strcmp(update, "resync") == 0) { /* make sure resync happens */ sb->state &= ~(1<recovery_cp = 0; - } - if (strcmp(update, "homehost") == 0 && - homehost) { + } else if (strcmp(update, "homehost") == 0 && + homehost) { uuid_set = 0; update = "uuid"; info->uuid[0] = sb->set_uuid0; info->uuid[1] = sb->set_uuid1; - } - if (strcmp(update, "uuid") == 0) { + } else if (strcmp(update, "uuid") == 0) { if (!uuid_set && homehost) { char buf[20]; char *hash = sha1_buffer(homehost, @@ -519,11 +572,19 @@ static int update_super0(struct supertype *st, struct mdinfo *info, if (sb->state & (1<uuid); + uuid_from_super0(st, uuid); + memcpy(bm->uuid, uuid, 16); } - } - if (strcmp(update, "_reshape_progress")==0) + } else if (strcmp(update, "no-bitmap") == 0) { + sb->state &= ~(1<reshape_position = info->reshape_progress; + else if (strcmp(update, "writemostly")==0) + sb->state |= (1<state &= ~(1<sb_csum = calc_sb0_csum(sb); return rv; @@ -540,12 +601,18 @@ static int update_super0(struct supertype *st, struct mdinfo *info, static int init_super0(struct supertype *st, mdu_array_info_t *info, unsigned long long size, char *ignored_name, char *homehost, - int *uuid) + int *uuid, long long data_offset) { mdp_super_t *sb; int spares; - if (posix_memalign((void**)&sb, 512, MD_SB_BYTES + sizeof(bitmap_super_t)) != 0) { + if (data_offset >= 0) { + fprintf(stderr, Name ": data-offset not support for 0.90\n"); + return 0; + } + + if (posix_memalign((void**)&sb, 4096, + MD_SB_BYTES + ROUND_UP(sizeof(bitmap_super_t), 4096)) != 0) { fprintf(stderr, Name ": %s could not allocate superblock\n", __func__); return 0; } @@ -571,7 +638,7 @@ static int init_super0(struct supertype *st, mdu_array_info_t *info, sb->gvalid_words = 0; /* ignored */ sb->ctime = time(0); sb->level = info->level; - if (size != info->size) + if (size != (unsigned long long)info->size) return 0; sb->size = info->size; sb->nr_disks = info->nr_disks; @@ -627,7 +694,7 @@ struct devinfo { #ifndef MDASSEMBLE /* Add a device to the superblock being created */ -static void add_to_super0(struct supertype *st, mdu_disk_info_t *dinfo, +static int add_to_super0(struct supertype *st, mdu_disk_info_t *dinfo, int fd, char *devname) { mdp_super_t *sb = st->sb; @@ -639,6 +706,8 @@ static void add_to_super0(struct supertype *st, mdu_disk_info_t *dinfo, dk->minor = dinfo->minor; dk->raid_disk = dinfo->raid_disk; dk->state = dinfo->state; + /* In case our source disk was writemostly, don't copy that bit */ + dk->state &= ~(1<this_disk = sb->disks[dinfo->number]; sb->sb_csum = calc_sb0_csum(sb); @@ -652,6 +721,8 @@ static void add_to_super0(struct supertype *st, mdu_disk_info_t *dinfo, di->disk = *dinfo; di->next = NULL; *dip = di; + + return 0; } #endif @@ -680,8 +751,8 @@ static int store_super0(struct supertype *st, int fd) if (super->state & (1<magic) == BITMAP_MAGIC) - if (write(fd, bm, ROUND_UP(sizeof(*bm),512)) != - ROUND_UP(sizeof(*bm),512)) + if (write(fd, bm, ROUND_UP(sizeof(*bm),4096)) != + ROUND_UP(sizeof(*bm),4096)) return 5; } @@ -702,8 +773,8 @@ static int write_init_super0(struct supertype *st) continue; if (di->fd == -1) continue; - Kill(di->devname, 0, 1, 1); - Kill(di->devname, 0, 1, 1); + while (Kill(di->devname, NULL, 0, 1, 1) == 0) + ; sb->disks[di->disk.number].state &= ~(1<devname); - close(di->fd); - di->fd = -1; } return rv; } @@ -741,8 +810,9 @@ static int compare_super0(struct supertype *st, struct supertype *tst) if (second->md_magic != MD_SB_MAGIC) return 1; if (!first) { - if (posix_memalign((void**)&first, 512, - MD_SB_BYTES + sizeof(struct bitmap_super_s)) != 0) { + if (posix_memalign((void**)&first, 4096, + MD_SB_BYTES + + ROUND_UP(sizeof(struct bitmap_super_s), 4096)) != 0) { fprintf(stderr, Name ": %s could not allocate superblock\n", __func__); return 1; @@ -788,9 +858,6 @@ static int load_super0(struct supertype *st, int fd, char *devname) free_super0(st); - if (st->subarray[0]) - return 1; - if (!get_dev_size(fd, devname, &dsize)) return 1; @@ -815,8 +882,9 @@ static int load_super0(struct supertype *st, int fd, char *devname) return 1; } - if (posix_memalign((void**)&super, 512, - MD_SB_BYTES + sizeof(bitmap_super_t)+512) != 0) { + if (posix_memalign((void**)&super, 4096, + MD_SB_BYTES + + ROUND_UP(sizeof(bitmap_super_t), 4096)) != 0) { fprintf(stderr, Name ": %s could not allocate superblock\n", __func__); return 1; @@ -864,8 +932,8 @@ static int load_super0(struct supertype *st, int fd, char *devname) * valid. If it doesn't clear the bit. An --assemble --force * should get that written out. */ - if (read(fd, super+1, ROUND_UP(sizeof(struct bitmap_super_s),512)) - != ROUND_UP(sizeof(struct bitmap_super_s),512)) + if (read(fd, super+1, ROUND_UP(sizeof(struct bitmap_super_s),4096)) + != ROUND_UP(sizeof(struct bitmap_super_s),4096)) goto no_bitmap; uuid_from_super0(st, uuid); @@ -883,10 +951,11 @@ static int load_super0(struct supertype *st, int fd, char *devname) static struct supertype *match_metadata_desc0(char *arg) { - struct supertype *st = malloc(sizeof(*st)); - if (!st) return st; + struct supertype *st = calloc(1, sizeof(*st)); + if (!st) + return st; - memset(st, 0, sizeof(*st)); + st->container_dev = NoMdDev; st->ss = &super0; st->info = NULL; st->minor_version = 90; @@ -896,9 +965,11 @@ static struct supertype *match_metadata_desc0(char *arg) while (arg[0] == '0' && arg[1] == '0') arg++; if (strcmp(arg, "0") == 0 || - strcmp(arg, "0.90") == 0 || +#ifdef DEFAULT_OLD_METADATA /* ifndef in super1.c */ strcmp(arg, "default") == 0 || - strcmp(arg, "") == 0 /* no metadata */ +#endif /* DEFAULT_OLD_METADATA */ + strcmp(arg, "0.90") == 0 || + strcmp(arg, "") == 0 /* no metadata - i.e. non_persistent */ ) return st; @@ -915,8 +986,11 @@ static struct supertype *match_metadata_desc0(char *arg) return NULL; } -static __u64 avail_size0(struct supertype *st, __u64 devsize) +static __u64 avail_size0(struct supertype *st, __u64 devsize, + long long data_offset) { + if (data_offset > 0) + return 0ULL; if (devsize < MD_RESERVED_SECTORS) return 0ULL; return MD_NEW_SIZE_SECTORS(devsize); @@ -934,11 +1008,12 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp, * size is in sectors, chunk is in bytes !!! */ unsigned long long bits; - unsigned long long max_bits = 60*1024*8; + unsigned long long max_bits = (60*1024 - sizeof(bitmap_super_t))*8; unsigned long long min_chunk; int chunk = *chunkp; mdp_super_t *sb = st->sb; bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MD_SB_BYTES); + int uuid[4]; min_chunk = 4096; /* sub-page chunks don't work yet.. */ @@ -947,9 +1022,14 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp, min_chunk *= 2; bits = (bits+1)/2; } - if (chunk == UnSet) + if (chunk == UnSet) { + /* A chunk size less than a few Megabytes gives poor + * performance without increasing resync noticeably + */ chunk = min_chunk; - else if (chunk < min_chunk) + if (chunk < 64*1024*1024) + chunk = 64*1024*1024; + } else if ((unsigned long long)chunk < min_chunk) return 0; /* chunk size too small */ sb->state |= (1<magic = __cpu_to_le32(BITMAP_MAGIC); bms->version = __cpu_to_le32(major); - uuid_from_super0(st, (int*)bms->uuid); + uuid_from_super0(st, uuid); + memcpy(bms->uuid, uuid, 16); bms->chunksize = __cpu_to_le32(chunk); bms->daemon_sleep = __cpu_to_le32(delay); bms->sync_size = __cpu_to_le64(size); @@ -996,13 +1077,11 @@ static int write_bitmap0(struct supertype *st, int fd) int rv = 0; int towrite, n; - char abuf[4096+512]; - char *buf = (char*)(((long)(abuf+512))&~511UL); + void *buf; if (!get_dev_size(fd, NULL, &dsize)) return 1; - if (dsize < MD_RESERVED_SECTORS*512) return -1; @@ -1013,9 +1092,12 @@ static int write_bitmap0(struct supertype *st, int fd) if (lseek64(fd, offset + 4096, 0)< 0LL) return 3; + if (posix_memalign(&buf, 4096, 4096)) + return -ENOMEM; + memset(buf, 0xff, 4096); memcpy(buf, ((char*)sb)+MD_SB_BYTES, sizeof(bitmap_super_t)); - towrite = 64*1024; + towrite = 60*1024; while (towrite > 0) { n = towrite; if (n > 4096) @@ -1031,6 +1113,7 @@ static int write_bitmap0(struct supertype *st, int fd) if (towrite) rv = -2; + free(buf); return rv; } @@ -1038,25 +1121,54 @@ static void free_super0(struct supertype *st) { if (st->sb) free(st->sb); + while (st->info) { + struct devinfo *di = st->info; + st->info = di->next; + if (di->fd >= 0) + close(di->fd); + free(di); + } st->sb = NULL; } #ifndef MDASSEMBLE static int validate_geometry0(struct supertype *st, int level, int layout, int raiddisks, - int chunk, unsigned long long size, + int *chunk, unsigned long long size, + long long data_offset, char *subdev, unsigned long long *freesize, int verbose) { unsigned long long ldsize; int fd; + unsigned int tbmax = 4; + + /* prior to linux 3.1, a but limits usable device size to 2TB. + * It was introduced in 2.6.29, but we won't worry about that detail + */ + if (get_linux_version() < 3001000) + tbmax = 2; - if (level == LEVEL_CONTAINER) + if (level == LEVEL_CONTAINER) { + if (verbose) + fprintf(stderr, Name ": 0.90 metadata does not support containers\n"); return 0; - if (raiddisks > MD_SB_DISKS) + } + if (raiddisks > MD_SB_DISKS) { + if (verbose) + fprintf(stderr, Name ": 0.90 metadata supports at most %d devices per array\n", + MD_SB_DISKS); return 0; - if (size > (0x7fffffffULL<<10)) + } + if (size >= tbmax * 2ULL*1024*1024*1024) { + if (verbose) + fprintf(stderr, Name ": 0.90 metadata supports at most " + "%d terabytes per device\n", tbmax); return 0; + } + if (chunk && *chunk == UnSet) + *chunk = DEFAULT_CHUNK; + if (!subdev) return 1; @@ -1076,8 +1188,6 @@ static int validate_geometry0(struct supertype *st, int level, if (ldsize < MD_RESERVED_SECTORS * 512) return 0; - if (size > (0x7fffffffULL<<10)) - return 0; *freesize = MD_NEW_SIZE_SECTORS(ldsize >> 9); return 1; } @@ -1097,6 +1207,7 @@ struct superswitch super0 = { .match_home = match_home0, .uuid_from_super = uuid_from_super0, .getinfo_super = getinfo_super0, + .container_content = container_content0, .update_super = update_super0, .init_super = init_super0, .store_super = store_super0, @@ -1108,4 +1219,5 @@ struct superswitch super0 = { .locate_bitmap = locate_bitmap0, .write_bitmap = write_bitmap0, .free_super = free_super0, + .name = "0.90", };