Fix an overflow problem which prevented revive from working on plexes

of more than 4 GB.

Reported by: dg
This commit is contained in:
Greg Lehey 1999-01-06 23:11:29 +00:00
parent 2267af789e
commit acf3160e71
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42361

View file

@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
* $Id: revive.c,v 1.5 1998/12/28 04:56:23 peter Exp $
* $Id: vinumrevive.c,v 1.6 1998/12/28 16:28:23 peter Exp $
*/
#define REALLYKERNEL
@ -62,7 +62,7 @@ revive_block(int plexno)
else
plex->revive_blocksize = DEFAULT_REVIVE_BLOCKSIZE;
}
size = min(plex->revive_blocksize, (plex->length - plex->revived) << DEV_BSHIFT);
size = min(plex->revive_blocksize >> DEV_BSHIFT, plex->length - plex->revived) << DEV_BSHIFT;
s = splbio();
/* Get a buffer */