aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index bb28fd6b44fe..020143dec180 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5788,6 +5788,18 @@ static void *raid5_takeover(mddev_t *mddev)
5788 return ERR_PTR(-EINVAL); 5788 return ERR_PTR(-EINVAL);
5789} 5789}
5790 5790
5791static void *raid4_takeover(mddev_t *mddev)
5792{
5793 /* raid4 can take over raid5 if layout is right.
5794 */
5795 if (mddev->level == 5 &&
5796 mddev->layout == ALGORITHM_PARITY_N) {
5797 mddev->new_layout = 0;
5798 mddev->new_level = 4;
5799 return setup_conf(mddev);
5800 }
5801 return ERR_PTR(-EINVAL);
5802}
5791 5803
5792static struct mdk_personality raid5_personality; 5804static struct mdk_personality raid5_personality;
5793 5805
@@ -5903,6 +5915,7 @@ static struct mdk_personality raid4_personality =
5903 .start_reshape = raid5_start_reshape, 5915 .start_reshape = raid5_start_reshape,
5904 .finish_reshape = raid5_finish_reshape, 5916 .finish_reshape = raid5_finish_reshape,
5905 .quiesce = raid5_quiesce, 5917 .quiesce = raid5_quiesce,
5918 .takeover = raid4_takeover,
5906}; 5919};
5907 5920
5908static int __init raid5_init(void) 5921static int __init raid5_init(void)