From b441812ca56619c1487aade2153304356342e0bb Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Fri, 2 Jun 2000 04:05:40 +0000 Subject: [PATCH] parityrebuild: write the parity block back to the correct subdisk. HEADS UP: This fixes a serious data corruption bug when using the userland command 'rebuildparity'. --- sys/dev/vinum/vinumrevive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/vinum/vinumrevive.c b/sys/dev/vinum/vinumrevive.c index 53013623483..f52869e7d45 100644 --- a/sys/dev/vinum/vinumrevive.c +++ b/sys/dev/vinum/vinumrevive.c @@ -37,7 +37,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: vinumrevive.c,v 1.13 2000/05/10 22:43:01 grog Exp grog $ + * $Id: vinumrevive.c,v 1.10 2000/01/03 03:40:54 grog Exp grog $ * $FreeBSD$ */ @@ -413,7 +413,7 @@ parityrebuild(struct plex *plex, if (sdno == psd) parity_buf = (int *) bpp[sdno]->b_data; if (sdno == newpsd) /* the new one? */ - bpp[sdno]->b_dev = VINUM_SD(psd); /* write back to the parity SD */ + bpp[sdno]->b_dev = VINUM_SD(plex->sdnos[psd]); /* write back to the parity SD */ else bpp[sdno]->b_dev = VINUM_SD(plex->sdnos[sdno]); /* device number */ bpp[sdno]->b_iocmd = BIO_READ; /* either way, read it */