diff options
| author | oster <oster@NetBSD.org> | 2002-11-21 15:37:55 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2002-11-21 15:37:55 +0000 |
| commit | 9768cda12b29503cbf7e56b94ae3fe15ec157d60 (patch) | |
| tree | 699cfe872edabf1cb0d2eb68a692bec72135fddf /sys/dev/raidframe | |
| parent | 2ca4879bd1013ebc21a27e6678b7dfafc30ed885 (diff) | |
Fix up locking on a call to rf_update_component_labels().
Noticed by Manuel. Thanks Manuel!
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index a6d2ae5657a..23045819c20 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.150 2002/11/19 01:49:41 oster Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.151 2002/11/21 15:37:55 oster Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -114,7 +114,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.150 2002/11/19 01:49:41 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.151 2002/11/21 15:37:55 oster Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -1682,7 +1682,6 @@ raidstart(raidPtr) { RF_SectorCount_t num_blocks, pb, sum; RF_RaidAddr_t raid_addr; - int retcode; struct partition *pp; daddr_t blocknum; int unit; @@ -1696,8 +1695,10 @@ raidstart(raidPtr) /* quick check to see if anything has died recently */ RF_LOCK_MUTEX(raidPtr->mutex); if (raidPtr->numNewFailures > 0) { + RF_UNLOCK_MUTEX(raidPtr->mutex); rf_update_component_labels(raidPtr, RF_NORMAL_COMPONENT_UPDATE); + RF_LOCK_MUTEX(raidPtr->mutex); raidPtr->numNewFailures--; } @@ -1781,11 +1782,15 @@ raidstart(raidPtr) /* don't ever condition on bp->b_flags & B_WRITE. * always condition on B_READ instead */ - retcode = rf_DoAccess(raidPtr, (bp->b_flags & B_READ) ? + bp->b_error = rf_DoAccess(raidPtr, (bp->b_flags & B_READ) ? RF_IO_TYPE_READ : RF_IO_TYPE_WRITE, do_async, raid_addr, num_blocks, bp->b_data, bp, RF_DAG_NONBLOCKING_IO); + if (bp->b_error) { + bp->b_flags |= B_ERROR; + } + RF_LOCK_MUTEX(raidPtr->mutex); } RF_UNLOCK_MUTEX(raidPtr->mutex); |
