summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2000-12-20 11:17:09 +0000
committerdes <des@FreeBSD.org>2000-12-20 11:17:09 +0000
commit44f312b9eb439044771b085964c1ae450b3f6331 (patch)
treecec8bd48d5171d886e3618974d391e602d44561f
parent9159e35114db0e45356e768e7524110f99df6220 (diff)
downloadFreeBSD-src-44f312b9eb439044771b085964c1ae450b3f6331.zip
FreeBSD-src-44f312b9eb439044771b085964c1ae450b3f6331.tar.gz
Re-commit revision 1.32, which grog incorrectly backed out in revision 1.33.
-rw-r--r--sys/dev/vinum/vinumrevive.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/vinum/vinumrevive.c b/sys/dev/vinum/vinumrevive.c
index 4b03c5d..a3cbdb6 100644
--- a/sys/dev/vinum/vinumrevive.c
+++ b/sys/dev/vinum/vinumrevive.c
@@ -97,9 +97,11 @@ revive_block(int sdno)
case plex_striped:
stripeoffset = sd->revived % plex->stripesize; /* offset from beginning of stripe */
+ if (stripeoffset + (size >> DEV_BSHIFT) > plex->stripesize)
+ size = (plex->stripesize - stripeoffset) << DEV_BSHIFT;
plexblkno = sd->plexoffset /* base */
+ (sd->revived - stripeoffset) * plex->subdisks /* offset to beginning of stripe */
- + sd->revived % plex->stripesize; /* offset from beginning of stripe */
+ + stripeoffset; /* offset from beginning of stripe */
break;
case plex_raid4:
@@ -107,7 +109,7 @@ revive_block(int sdno)
stripeoffset = sd->revived % plex->stripesize; /* offset from beginning of stripe */
plexblkno = sd->plexoffset /* base */
+ (sd->revived - stripeoffset) * (plex->subdisks - 1) /* offset to beginning of stripe */
- +stripeoffset; /* offset from beginning of stripe */
+ + stripeoffset; /* offset from beginning of stripe */
stripe = (sd->revived / plex->stripesize); /* stripe number */
/* Make sure we don't go beyond the end of the band. */
@@ -153,8 +155,8 @@ revive_block(int sdno)
lock = lockrange(plexblkno << DEV_BSHIFT, bp, plex); /* lock it */
if (vol != NULL) /* it's part of a volume, */
/*
- * First, read the data from the volume. We
- * don't care which plex, that's bre's job.
+ * First, read the data from the volume. We
+ * don't care which plex, that's bre's job.
*/
bp->b_dev = VINUMDEV(plex->volno, 0, 0, VINUM_VOLUME_TYPE); /* create the device number */
else /* it's an unattached plex */
OpenPOWER on IntegriCloud