]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Report error when grow cannot be restarted.
authorNeil Brown <neilb@suse.de>
Mon, 20 Aug 2007 04:14:42 +0000 (14:14 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 20 Aug 2007 04:14:42 +0000 (14:14 +1000)
Make sure that if --assemble find an array in the critical region
of a reshape, and cannot find the critical data to restart the
reshape, it gives an error message.

ChangeLog
Grow.c

index 6a525f0dcd8314a761e274feaa88261c08b6fd28..4ae4dade2730ee91d7768b3944dcf95c16f41824 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ Changes Prior to this release
        1.x array was created with older mdadm).
     -   When adding a drive that was a little too small, we did not get
        the correct error message.
+    -   Make sure that if --assemble find an array in the critical region
+       of a reshape, and cannot find the critical data to restart the
+       reshape, it gives an error message.
 
 Changes Prior to 2.6.2 release
     -   --fail detached and --remove faulty can be used to fail and
diff --git a/Grow.c b/Grow.c
index 52907fa0a83934cc352caab6ef26b899cf4e58bf..825747e71b31715c1b8b9f67f09d8da71f05e4a9 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -867,7 +867,6 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
 {
        int i, j;
        int old_disks;
-       int err = 0;
        unsigned long long *offsets;
 
        if (info->delta_disks < 0)
@@ -960,7 +959,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
                                    fd, __le64_to_cpu(bsb.devstart)*512,
                                    0, __le64_to_cpu(bsb.length)*512)) {
                        /* didn't succeed, so giveup */
-                       return -1;
+                       return 1;
                }
 
                /* Ok, so the data is restored. Let's update those superblocks. */
@@ -979,5 +978,5 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
                /* And we are done! */
                return 0;
        }
-       return err;
+       return 1;
 }