From bf7dfe61ab517d79a8dc06cb80a57f9aa8873cde Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Thu, 4 May 2000 07:38:47 +0000 Subject: [PATCH] expand_table: Avoid a race condition which may have been contributing to the random corruption, panics and hangs we've been seeing in RAID-5 plexes, particularly with ata drives. Eagerly-awaited-by: sos --- sys/dev/vinum/vinummemory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/vinum/vinummemory.c b/sys/dev/vinum/vinummemory.c index 59b5d5a94fe4..8e501a27e2b2 100644 --- a/sys/dev/vinum/vinummemory.c +++ b/sys/dev/vinum/vinummemory.c @@ -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: vinummemory.c,v 1.23 1999/12/27 04:04:19 grog Exp grog $ + * $Id: vinummemory.c,v 1.24 2000/02/24 07:25:51 grog Exp grog $ * $FreeBSD$ */ @@ -110,7 +110,9 @@ expand_table(void **table, int oldsize, int newsize) { if (newsize > oldsize) { int *temp; + int s; + s = splhigh(); temp = (int *) Malloc(newsize); /* allocate a new table */ CHECKALLOC(temp, "vinum: Can't expand table\n"); bzero((char *) temp, newsize); /* clean it all out */ @@ -119,6 +121,7 @@ expand_table(void **table, int oldsize, int newsize) Free(*table); } *table = temp; + splx(s); } }