Skip to content

Commit

Permalink
md/raid0: improve error message when converting RAID4-with-spares to …
Browse files Browse the repository at this point in the history
…RAID0

Mentioning "bad disk number -1" exposes irrelevant internal detail.
Just say they are inactive and must be removed.

Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
neilbrown committed Feb 26, 2013
1 parent 58ebb34 commit f96c9f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/md/raid0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f96c9f3

Please sign in to comment.