X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=Grow.c;h=bbdd46c0e600dc8c245e9e8a51766ae9bcaee4c0;hb=50d72ed4298618c679efd43647dd055527e59b10;hp=90a7fe95e13feb466b99cbd9cd15eeebf9ec294b;hpb=7c25f4d706ac14165fd8d85b169f491f1f14b7cc;p=thirdparty%2Fmdadm.git diff --git a/Grow.c b/Grow.c old mode 100644 new mode 100755 index 90a7fe95..bbdd46c0 --- a/Grow.c +++ b/Grow.c @@ -297,6 +297,9 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) " between different architectures. Consider upgrading the Linux kernel.\n"); } + if (s->bitmap_file && strcmp(s->bitmap_file, "clustered") == 0) + major = BITMAP_MAJOR_CLUSTERED; + if (ioctl(fd, GET_BITMAP_FILE, &bmf) != 0) { if (errno == ENOMEM) pr_err("Memory allocation failure.\n"); @@ -325,12 +328,15 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) if (strcmp(s->bitmap_file, "none")==0) { array.state &= ~(1<bitmap_file, devname); + pr_err("bitmap already present on %s\n", devname); return 1; } @@ -412,7 +418,7 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) bitmapsize, offset_setable, major) ) - st->ss->write_bitmap(st, fd2); + st->ss->write_bitmap(st, fd2, NoUpdate); else { pr_err("failed to create internal bitmap - chunksize problem.\n"); close(fd2); @@ -616,10 +622,8 @@ static void unfreeze(struct supertype *st) if (sra && sysfs_get_str(sra, NULL, "sync_action", buf, 20) > 0 - && strcmp(buf, "frozen\n") == 0) { - printf("unfreeze\n"); + && strcmp(buf, "frozen\n") == 0) sysfs_set_str(sra, NULL, "sync_action", "idle"); - } sysfs_free(sra); } } @@ -1586,6 +1590,15 @@ int Grow_reshape(char *devname, int fd, pr_err("Cannot increase raid-disks on this array beyond %d\n", st->max_devs); return 1; } + if (s->level == 0 && + (array.state & (1<cache_size < cache) subarray_set_num(container, sra, "stripe_cache_size", @@ -4502,8 +4515,8 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt * sometimes they aren't... So allow considerable flexability in matching, and allow * this test to be overridden by an environment variable. */ - if (info->array.utime > (int)__le64_to_cpu(bsb.mtime) + 2*60*60 || - info->array.utime < (int)__le64_to_cpu(bsb.mtime) - 10*60) { + if(time_after(info->array.utime, (unsigned int)__le64_to_cpu(bsb.mtime) + 2*60*60) || + time_before(info->array.utime, (unsigned int)__le64_to_cpu(bsb.mtime) - 10*60)) { if (check_env("MDADM_GROW_ALLOW_OLD")) { pr_err("accepting backup with timestamp %lu for array with timestamp %lu\n", (unsigned long)__le64_to_cpu(bsb.mtime), @@ -4872,6 +4885,9 @@ int Grow_continue_command(char *devname, int fd, sysfs_init(content, fd2, mdstat->devnm); + close(fd2); + fd2 = -1; + /* start mdmon in case it is not running */ if (!mdmon_running(container))