]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: improve messages when restarting a reshape.
authorNeilBrown <neilb@suse.de>
Tue, 2 Jul 2013 03:09:07 +0000 (13:09 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 2 Jul 2013 03:09:07 +0000 (13:09 +1000)
If the restarted reshape needs a backup file and we don't have one,
that should be reported before we try to start the array.
Also we shouldn't say the "Cannot grow" but "cannot complete".

Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c
Grow.c

index afe5b05004af78287b370dcdf39bc4c44cac2736..294c9926b98078484dab6b5713b647fd1f4f23b5 100644 (file)
@@ -1007,6 +1007,15 @@ static int start_array(int mdfd,
                if (content->reshape_active &&
                    !(content->reshape_active & RESHAPE_NO_BACKUP) &&
                    content->delta_disks <= 0) {
+                       if (!c->backup_file) {
+                               pr_err("%s: Need a backup file to complete reshape of this array.\n",
+                                      mddev);
+                               pr_err("Please provided one with \"--backup-file=...\"\n");
+                               if (c->update &&
+                                   strcmp(c->update, "revert-reshape") == 0)
+                                       pr_err("(Don't specify --update=revert-reshape again, that part succeeded.)\n");
+                               return 1;
+                       }
                        rv = sysfs_set_str(content, NULL,
                                           "array_state", "readonly");
                        if (rv == 0)
diff --git a/Grow.c b/Grow.c
index e27d29ff0c3aa5ee6e81ce2e7580317a63473f12..8ca57e84ee6b460ff3af67a1a01c5ff25128fadf 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -3143,8 +3143,9 @@ started:
                if (backup_file == NULL) {
                        if (reshape.after.data_disks <=
                            reshape.before.data_disks) {
-                               pr_err("%s: Cannot grow - "
-                                       "need backup-file\n", devname);
+                               pr_err("%s: Cannot grow - need backup-file\n",
+                                      devname);
+                               pr_err(" Please provide one with \"--backup=...\"\n");
                                goto release;
                        } else if (sra->array.spare_disks == 0) {
                                pr_err("%s: Cannot grow - "