All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Grow: analyse_change add notification about only 2-device can be convert from RAID1 to RAID5
@ 2016-03-11  9:26 Yi Zhang
  2016-03-11 17:41 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Yi Zhang @ 2016-03-11  9:26 UTC (permalink / raw)
  To: linux-raid; +Cc: Jes.Sorensen, neilb, shli, xni, Yi Zhang

Notify "Can only convert a 2-device array to RAID5" instead of
"Impossibly level change request for RAID1" when convert from
RAID1 to RAID5 if the disk num is not equal two like RAID4/5->RAID1
did.

Signed-off-by: Yi Zhang <yizhan@redhat.com>
---
 Grow.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Grow.c b/Grow.c
index cf2750a..4e2fc08 100755
--- a/Grow.c
+++ b/Grow.c
@@ -1077,6 +1077,9 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
 			re->level = 1;
 			return NULL;
 		}
+		if (info->array.raid_disks != 2 &&
+		    info->new_level == 5)
+			return "Can only convert a 2-device array to RAID5";
 		if (info->array.raid_disks == 2 &&
 		    info->new_level == 5) {
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-11 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-11  9:26 [PATCH] Grow: analyse_change add notification about only 2-device can be convert from RAID1 to RAID5 Yi Zhang
2016-03-11 17:41 ` Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.