Commit 049d6c1e authored by Maciej Trela's avatar Maciej Trela Committed by NeilBrown

md: enable raid4->raid0 takeover

Only level 5 with layout=PARITY_N can be taken over to raid0 now.
Lets allow level 4 either.
Signed-off-by: default avatarMaciej Trela <maciej.trela@intel.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 001048a3
...@@ -569,7 +569,7 @@ static void raid0_status(struct seq_file *seq, mddev_t *mddev) ...@@ -569,7 +569,7 @@ static void raid0_status(struct seq_file *seq, mddev_t *mddev)
return; return;
} }
static void *raid0_takeover_raid5(mddev_t *mddev) static void *raid0_takeover_raid45(mddev_t *mddev)
{ {
mdk_rdev_t *rdev; mdk_rdev_t *rdev;
raid0_conf_t *priv_conf; raid0_conf_t *priv_conf;
...@@ -647,12 +647,16 @@ static void *raid0_takeover_raid10(mddev_t *mddev) ...@@ -647,12 +647,16 @@ static void *raid0_takeover_raid10(mddev_t *mddev)
static void *raid0_takeover(mddev_t *mddev) static void *raid0_takeover(mddev_t *mddev)
{ {
/* raid0 can take over: /* raid0 can take over:
* raid4 - if all data disks are active.
* raid5 - providing it is Raid4 layout and one disk is faulty * raid5 - providing it is Raid4 layout and one disk is faulty
* raid10 - assuming we have all necessary active disks * raid10 - assuming we have all necessary active disks
*/ */
if (mddev->level == 4)
return raid0_takeover_raid45(mddev);
if (mddev->level == 5) { if (mddev->level == 5) {
if (mddev->layout == ALGORITHM_PARITY_N) if (mddev->layout == ALGORITHM_PARITY_N)
return raid0_takeover_raid5(mddev); return raid0_takeover_raid45(mddev);
printk(KERN_ERR "md/raid0:%s: Raid can only takeover Raid5 with layout: %d\n", printk(KERN_ERR "md/raid0:%s: Raid can only takeover Raid5 with layout: %d\n",
mdname(mddev), ALGORITHM_PARITY_N); mdname(mddev), ALGORITHM_PARITY_N);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment