From ade9289ffe4799d0c6dbfa7e702984b75b8a07e3 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Thu, 7 Jun 2007 22:58:00 +0000 Subject: [PATCH] Don't loose count when adding too many plexes to a volume. --- sys/dev/raid/vinum/vinumconfig.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/raid/vinum/vinumconfig.c b/sys/dev/raid/vinum/vinumconfig.c index 1e671c2aa6..e2e4d530d7 100644 --- a/sys/dev/raid/vinum/vinumconfig.c +++ b/sys/dev/raid/vinum/vinumconfig.c @@ -47,7 +47,7 @@ * * $Id: vinumconfig.c,v 1.30 2000/05/01 09:45:50 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumconfig.c,v 1.32.2.6 2002/02/03 00:43:35 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumconfig.c,v 1.11 2007/03/10 09:47:29 swildner Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumconfig.c,v 1.12 2007/06/07 22:58:00 corecode Exp $ */ #define STATIC static @@ -1451,11 +1451,12 @@ config_volume(int update) "Plex %s already belongs to volume %s", token[parameter], vol->name); - else if (++vol->plexes > 8) /* another entry */ + else if (vol->plexes + 1 > 8) /* another entry */ throw_rude_remark(EINVAL, "Too many plexes for volume %s", vol->name); - vol->plex[vol->plexes - 1] = plexno; + vol->plex[vol->plexes] = plexno; + vol->plexes++; PLEX[plexno].state = plex_referenced; /* we know something about it */ PLEX[plexno].volno = volno; /* and this volume references it */ } -- 2.11.4.GIT