md/raid0: improve error message when converting RAID4-with-spares to RAID0
authorNeilBrown <neilb@suse.de>
Thu, 21 Feb 2013 04:50:07 +0000 (15:50 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 26 Feb 2013 00:58:44 +0000 (11:58 +1100)
Mentioning "bad disk number -1" exposes irrelevant internal detail.
Just say they are inactive and must be removed.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid0.c

index d9babda582b913caaf1260bd0c0fe625dcee1b9f..0505452de8d6ee2b3533c7930d62df544636b0c3 100644 (file)
@@ -175,7 +175,13 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
                        rdev1->new_raid_disk = j;
                }
 
-               if (j < 0 || j >= mddev->raid_disks) {
+               if (j < 0) {
+                       printk(KERN_ERR
+                              "md/raid0:%s: remove inactive devices before converting to RAID0\n",
+                              mdname(mddev));
+                       goto abort;
+               }
+               if (j >= mddev->raid_disks) {
                        printk(KERN_ERR "md/raid0:%s: bad disk number %d - "
                               "aborting!\n", mdname(mddev), j);
                        goto abort;