aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorGreg Lehey <grog@FreeBSD.org>1999-04-09 01:20:22 +0000
committerGreg Lehey <grog@FreeBSD.org>1999-04-09 01:20:22 +0000
commitd85bfa1067be4f063cbfaa5207eee2492b2f0f0c (patch)
tree51e8e905d47ce5f96087ce61ed9c73c5184664cb /sys/dev
parent4a10e9165303505243919cb924d9d35238f10f48 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/vinum/vinumconfig.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c
index 7fc6520bd860..67cd1c64b5ec 100644
--- a/sys/dev/vinum/vinumconfig.c
+++ b/sys/dev/vinum/vinumconfig.c
@@ -1826,19 +1826,21 @@ update_plex_config(int plexno, int diskconfig)
* the stripe size. If not, trim off the end
* of each subdisk and return it to the drive.
*/
- remainder = (int) (plex->length % ((u_int64_t) plex->stripesize * data_sds)); /* are we exact? */
- if (remainder) { /* no */
- log(LOG_INFO, "vinum: removing %d blocks of partial stripe at the end of %s\n",
- remainder,
- plex->name);
- plex->length -= remainder; /* shorten the plex */
- remainder /= data_sds; /* spread the remainder amongst the sds */
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
- return_drive_space(sd->driveno, /* return the space */
- sd->driveoffset + sd->sectors - remainder,
- remainder);
- sd->sectors -= remainder; /* and shorten it */
+ if (plex->length > 0) {
+ remainder = (int) (plex->length % ((u_int64_t) plex->stripesize * data_sds)); /* are we exact? */
+ if (remainder) { /* no */
+ log(LOG_INFO, "vinum: removing %d blocks of partial stripe at the end of %s\n",
+ remainder,
+ plex->name);
+ plex->length -= remainder; /* shorten the plex */
+ remainder /= data_sds; /* spread the remainder amongst the sds */
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
+ return_drive_space(sd->driveno, /* return the space */
+ sd->driveoffset + sd->sectors - remainder,
+ remainder);
+ sd->sectors -= remainder; /* and shorten it */
+ }
}
}
}