diff options
author | Greg Lehey <grog@FreeBSD.org> | 1998-11-03 06:37:14 +0000 |
---|---|---|
committer | Greg Lehey <grog@FreeBSD.org> | 1998-11-03 06:37:14 +0000 |
commit | 62ae0ffa9557750d59a6432365b5d88c17a3f15e (patch) | |
tree | 9de2dd5cb266a784ceb81f8f9a6f640886fe0ead /sys/dev/vinum | |
parent | 780ebb4b00b2754a926d6b570dd848cc278f6123 (diff) | |
download | src-62ae0ffa9557750d59a6432365b5d88c17a3f15e.tar.gz src-62ae0ffa9557750d59a6432365b5d88c17a3f15e.zip |
Check for duplicate subdisk names
Notes
Notes:
svn path=/head/; revision=40844
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r-- | sys/dev/vinum/vinumconfig.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c index ccb14e195b7b..24df1019872a 100644 --- a/sys/dev/vinum/vinumconfig.c +++ b/sys/dev/vinum/vinumconfig.c @@ -44,7 +44,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: config.c,v 1.20 1998/10/26 02:05:34 grog Exp grog $ + * $Id: config.c,v 1.19 1998/10/05 02:48:15 grog Exp grog $ */ #define STATIC /* nothing while we're testing XXX */ @@ -968,6 +968,7 @@ config_subdisk(void) int sectors; /* sector offset value */ int detached = 0; /* set to 1 if this is a detached subdisk */ int sdindex = -1; /* index in plexes subdisk table */ + int namedsdno; sdno = get_empty_sd(); /* allocate an SD to initialize */ sd = &SD[sdno]; /* and get a pointer */ @@ -994,7 +995,9 @@ config_subdisk(void) break; case kw_name: - ++parameter; + namedsdno = find_subdisk(token[++parameter], 0); /* find an existing sd with this name */ + if (namedsdno >= 0) + throw_rude_remark(EINVAL, "Duplicate subdisk %s", token[parameter]); bcopy(token[parameter], sd->name, min(sizeof(sd->name), strlen(token[parameter]))); @@ -1080,6 +1083,7 @@ config_plex(void) struct plex *plex; /* and pointer to it */ int pindex = MAXPLEX; /* index in volume's plex list */ int detached = 0; /* don't give it to a volume */ + int namedplexno; current_plex = -1; /* forget the previous plex */ plexno = get_empty_plex(); /* allocate a plex */ @@ -1092,13 +1096,9 @@ config_plex(void) break; case kw_name: - { - int namedplexno; - - namedplexno = find_plex(token[++parameter], 0); /* find an existing plex with this name */ - if (namedplexno >= 0) - throw_rude_remark(EINVAL, "Duplicate plex %s", token[parameter]); - } + namedplexno = find_plex(token[++parameter], 0); /* find an existing plex with this name */ + if (namedplexno >= 0) + throw_rude_remark(EINVAL, "Duplicate plex %s", token[parameter]); bcopy(token[parameter], /* put in the name */ plex->name, min(MAXPLEXNAME, strlen(token[parameter]))); |