X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=super0.c;h=e855541369e797db7a420c2000bdf27c65a71229;hb=666bba9b5011150ff01de421dd44b06c0a6610a5;hp=5db118ca39c2c40bd391c7147cd7d8d2e55e9780;hpb=8562409dd17ab4910befcbfaba8fe8b751418b6b;p=thirdparty%2Fmdadm.git diff --git a/super0.c b/super0.c index 5db118ca..e8555413 100644 --- a/super0.c +++ b/super0.c @@ -389,7 +389,7 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info) /* 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<sb; @@ -427,7 +428,7 @@ static int update_super0(struct supertype *st, struct mdinfo *info, devname, info->array.md_minor); } if (strcmp(update, "summaries") == 0) { - int i; + unsigned int i; /* set nr_disks, active_disks, working_disks, * failed_disks, spare_disks based on disks[] * array in superblock. @@ -487,10 +488,24 @@ static int update_super0(struct supertype *st, struct mdinfo *info, */ add = (1<disks[d].state & ~mask) | add) - != info->disk.state) { + != (unsigned)info->disk.state) { sb->disks[d].state = info->disk.state | wonly; 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; + } + 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 (strcmp(update, "linear-grow-new") == 0) { memset(&sb->disks[info->disk.number], 0, sizeof(sb->disks[0])); @@ -542,6 +557,8 @@ static int update_super0(struct supertype *st, struct mdinfo *info, bm = (struct bitmap_super_s*)(sb+1); uuid_from_super0(st, (int*)bm->uuid); } + } else if (strcmp(update, "no-bitmap") == 0) { + sb->state &= ~(1<reshape_position = info->reshape_progress; @@ -593,7 +610,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; @@ -982,7 +999,7 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp, chunk = min_chunk; if (chunk < 64*1024*1024) chunk = 64*1024*1024; - } else if (chunk < min_chunk) + } else if ((unsigned long long)chunk < min_chunk) return 0; /* chunk size too small */ sb->state |= (1<