From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Grover Subject: [PATCH 1/2] dm-raid: Fix minimal device check Date: Wed, 28 Oct 2015 11:50:00 -0700 Message-ID: <1446058201-12628-1-git-send-email-agrover@redhat.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: dm-devel@redhat.com List-Id: dm-devel.ids Check raid_type->minimal_devs instead of parity_devs. minimal_devs is used nowhere else (and makes sense to use here) so I think this is what was intended. Signed-off-by: Andy Grover --- drivers/md/dm-raid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index a090121..5941cfd 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -151,7 +151,7 @@ static struct raid_set *context_alloc(struct dm_target *ti, struct raid_type *ra unsigned i; struct raid_set *rs; - if (raid_devs <= raid_type->parity_devs) { + if (raid_devs < raid_type->minimal_devs) { ti->error = "Insufficient number of devices"; return ERR_PTR(-EINVAL); } -- 2.4.3