]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Grow.c
Find super from fd on an array.
[thirdparty/mdadm.git] / Grow.c
diff --git a/Grow.c b/Grow.c
index e07e2c066b9d7957b17ae60d5b74fe71a4c74048..3c22741c078c4506fdd969952adfc4404d81ae56 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -58,7 +58,7 @@ int Grow_Add_device(char *devname, int fd, char *newdev)
                return 1;
        }
 
-       st = super_by_version(info.array.major_version, info.array.minor_version);
+       st = super_by_fd(fd);
        if (!st) {
                fprintf(stderr, Name ": cannot handle arrays with superblock version %d\n", info.array.major_version);
                return 1;
@@ -277,7 +277,7 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
                bitmapsize = bitmapsize * array.raid_disks / ncopies;
        }
 
-       st = super_by_version(array.major_version, array.minor_version);
+       st = super_by_fd(fd);
        if (!st) {
                fprintf(stderr, Name ": Cannot understand version %d.%d\n",
                        array.major_version, array.minor_version);
@@ -519,8 +519,8 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
        case 4:
        case 5:
        case 6:
-               st = super_by_version(array.major_version,
-                                     array.minor_version);
+               st = super_by_fd(fd);
+
                /* size can be changed independently.
                 * layout/chunksize/raid_disks/level can be changed
                 * though the kernel may not support it all.