Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/raidframe When adding a hot spare, remember to lock ...



details:   https://anonhg.NetBSD.org/src/rev/c352fd17268a
branches:  trunk
changeset: 473437:c352fd17268a
user:      oster <oster%NetBSD.org@localhost>
date:      Fri Jun 04 02:02:39 1999 +0000

description:
When adding a hot spare, remember to lock down the main raidPtr
structure before mucking with its contents.

diffstat:

 sys/dev/raidframe/rf_disks.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r 5fab917b4990 -r c352fd17268a sys/dev/raidframe/rf_disks.c
--- a/sys/dev/raidframe/rf_disks.c      Fri Jun 04 01:51:00 1999 +0000
+++ b/sys/dev/raidframe/rf_disks.c      Fri Jun 04 02:02:39 1999 +0000
@@ -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 @@
                return(EINVAL);
        }
 
+       RF_LOCK_MUTEX(raidPtr->mutex);
+
        /* the beginning of the spares... */
        disks = &raidPtr->Disks[0][raidPtr->numCol];
 
@@ -854,9 +856,11 @@
                                 
 
        raidPtr->numSpare++;
+       RF_UNLOCK_MUTEX(raidPtr->mutex);
        return (0);
 
 fail:
+       RF_UNLOCK_MUTEX(raidPtr->mutex);
        return(ret);
 }
 



Home | Main Index | Thread Index | Old Index