]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: check if any changes needed before proceeding to analyse_change.
authorNeilBrown <neilb@suse.de>
Tue, 10 May 2011 01:49:57 +0000 (11:49 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 10 May 2011 01:49:57 +0000 (11:49 +1000)
Analyse_change can give unhelpful error messages if nothing was
changed.  This is particularly awkward when only changing --size.

So check and re-introduce a message that was list in commit
5da9ab9874cb

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

diff --git a/Grow.c b/Grow.c
index f910277edf361323c151152aa969e21271ce1b1e..e09e9ab30fe928e1f2053428331e8d0557807274 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1496,6 +1496,18 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
                        size = array.size;
        }
 
+       /* See if there is anything else to do */
+       if ((level == UnSet || level == array.level) &&
+           (layout_str == NULL) &&
+           (chunksize == 0 || chunksize == array.chunk_size) &&
+           (raid_disks == 0 || raid_disks == array.raid_disks)) {
+               /* Nothing more to do */
+               if (!changed && !quiet)
+                       fprintf(stderr, Name ": %s: no change requested\n",
+                               devname);
+               goto release;
+       }
+
        /* ========= check for Raid10/Raid1 -> Raid0 conversion ===============
         * current implementation assumes that following conditions must be met:
         * - RAID10: