summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinumioctl.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/vinum/vinumioctl.c b/sys/dev/vinum/vinumioctl.c
index 309448a..8780e1c 100644
--- a/sys/dev/vinum/vinumioctl.c
+++ b/sys/dev/vinum/vinumioctl.c
@@ -688,10 +688,12 @@ detachobject(struct vinum_ioctl_msg *msg)
(plex->subdisks - 1 - sdno) * sizeof(int));
}
plex->subdisks--;
- if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* this subdisk is named after the plex */
+ if (!bcmp(plex->name, sd->name, strlen(plex->name) + 1))
+ /* this subdisk is named after the plex */
+ {
bcopy(sd->name,
&sd->name[3],
- min(strlen(sd->name), MAXSDNAME - 3));
+ min(strlen(sd->name) + 1, MAXSDNAME - 3));
bcopy("ex-", sd->name, 3);
sd->name[MAXSDNAME - 1] = '\0';
}
@@ -735,7 +737,9 @@ detachobject(struct vinum_ioctl_msg *msg)
(vol->plexes - 1 - plexno) * sizeof(int));
vol->plexes--;
vol->last_plex_read = 0; /* don't go beyond the end */
- if (!bcmp(vol->name, plex->name, strlen(vol->name))) { /* this plex is named after the volume */
+ if (!bcmp(vol->name, plex->name, strlen(vol->name) + 1))
+ /* this plex is named after the volume */
+ {
/* First, check if the subdisks are the same */
if (msg->recurse) {
int sdno;
@@ -743,14 +747,20 @@ detachobject(struct vinum_ioctl_msg *msg)
for (sdno = 0; sdno < plex->subdisks; sdno++) {
struct sd *sd = &SD[plex->sdnos[sdno]];
- if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* subdisk is named after the plex */
- bcopy(sd->name, &sd->name[3], min(strlen(sd->name), MAXSDNAME - 3));
+ if (!bcmp(plex->name, sd->name, strlen(plex->name) + 1))
+ /* subdisk is named after the plex */
+ {
+ bcopy(sd->name,
+ &sd->name[3],
+ min(strlen(sd->name) + 1, MAXSDNAME - 3));
bcopy("ex-", sd->name, 3);
sd->name[MAXSDNAME - 1] = '\0';
}
}
}
- bcopy(plex->name, &plex->name[3], min(strlen(plex->name), MAXPLEXNAME - 3));
+ bcopy(plex->name,
+ &plex->name[3],
+ min(strlen(plex->name) + 1, MAXPLEXNAME - 3));
bcopy("ex-", plex->name, 3);
plex->name[MAXPLEXNAME - 1] = '\0';
}
OpenPOWER on IntegriCloud