From: Yi Zhang <yizhan@redhat.com>
To: linux-raid@vger.kernel.org
Cc: Jes.Sorensen@redhat.com, neilb@suse.com, shli@kernel.org,
xni@redhat.com, Yi Zhang <yizhan@redhat.com>
Subject: [PATCH] Grow: analyse_change add notification about only 2-device can be convert from RAID1 to RAID5
Date: Fri, 11 Mar 2016 17:26:40 +0800 [thread overview]
Message-ID: <1457688400-12666-1-git-send-email-yizhan@redhat.com> (raw)
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
next reply other threads:[~2016-03-11 9:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 9:26 Yi Zhang [this message]
2016-03-11 17:41 ` [PATCH] Grow: analyse_change add notification about only 2-device can be convert from RAID1 to RAID5 Jes Sorensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457688400-12666-1-git-send-email-yizhan@redhat.com \
--to=yizhan@redhat.com \
--cc=Jes.Sorensen@redhat.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
--cc=shli@kernel.org \
--cc=xni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox