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'.
This commit is contained in:
Greg Lehey 2000-06-02 04:05:40 +00:00
parent cad166c211
commit b441812ca5
1 changed files with 2 additions and 2 deletions

View File

@ -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 */