[dm-devel] [PATCH 1/2] dm-raid: Fix minimal device check

Andy Grover agrover at redhat.com
Wed Oct 28 18:50:00 UTC 2015


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 <agrover at redhat.com>
---
 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




More information about the dm-devel mailing list