summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>1999-06-04 02:02:39 +0000
committeroster <oster@NetBSD.org>1999-06-04 02:02:39 +0000
commit8c39e1bf02b630a157629c0686a8656dc8e9d881 (patch)
tree29cddf146f905a360e91b7659f0c2bebd4545022 /sys/dev/raidframe
parent60769ea563954d1aa7e1ff086a6d9b65110fa991 (diff)
When adding a hot spare, remember to lock down the main raidPtr
structure before mucking with its contents.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_disks.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c
index 0df84d1775b..fc25a0c4b1d 100644
--- a/sys/dev/raidframe/rf_disks.c
+++ b/sys/dev/raidframe/rf_disks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_disks.c,v 1.9 1999/06/04 01:50:01 oster Exp $ */
+/* $NetBSD: rf_disks.c,v 1.10 1999/06/04 02:02:39 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -791,6 +791,8 @@ rf_add_hot_spare(raidPtr, sparePtr)
return(EINVAL);
}
+ RF_LOCK_MUTEX(raidPtr->mutex);
+
/* the beginning of the spares... */
disks = &raidPtr->Disks[0][raidPtr->numCol];
@@ -854,9 +856,11 @@ rf_add_hot_spare(raidPtr, sparePtr)
raidPtr->numSpare++;
+ RF_UNLOCK_MUTEX(raidPtr->mutex);
return (0);
fail:
+ RF_UNLOCK_MUTEX(raidPtr->mutex);
return(ret);
}